Re: ssh et option -t
Vincent Lefevre wrote:
-c c'est une option de chiffrement complètement indépendante.
Ça m'apprendra à ne pas avoir fait "man ssh" avant d'écrire :)
J'étais persuadé que ce serait l'équivalent de "sh -c" pour ssh, afin
d'indiquer la commande.
> Je
suppose plutôt que c'est pour transférer des fichiers par exemple
(ce que fait scp) ou plus généralement pour installer un tunnel ssh.
Je pensais à la sortie binaire d'une commande (quel que soit cette
commande).
Au hasard 'cat image.png', et hop, ça permet de faire une copie de
fichier (comme tu l'indiques).
Avec un fichier binaire : awstats-5.91.tgz.gz.
$ (ssh localhost cat awstats-5.91.tgz.gz ) > /tmp/toto2
ls -al /tmp/toto2
=> 699800 aoû 5 15:13 /tmp/toto2
$ (ssh -t localhost cat awstats-5.91.tgz.gz ) > /tmp/toto2
ls -al /tmp/toto2
=> 702575 aoû 5 15:13 /tmp/toto2
$ (ssh -T localhost cat awstats-5.91.tgz.gz ) > /tmp/toto2
ls -al /tmp/toto2
=> 699800 aoû 5 15:13 /tmp/toto2
avec -t, le fichier est corrompu.
avec -T, le fichier est nickel.
sans, comme il y a une commande en argument, c'est -T par défaut.
Le même exemple sur /etc/passwd change les CR en CRLF si l'on utilise -t :
$ od -a /etc/passwd
0000000 r o o t : x : 0 : 0 : r o o t :
0000020 / r o o t : / b i n / b a s h nl
$ od -a /tmp/toto2
0000000 r o o t : x : 0 : 0 : r o o t :
0000020 / r o o t : / b i n / b a s h cr
0000040 nl
ssh cause au terminal, ça paraît normal.
Ben en tout cas, j'apprends et expérimente plein de trucs avec mon petit
problème de bash, merci :)
--
pii233
Reply to: