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



Répondre à