ssh -C

what do the option " -C " [ uppercase c ] for ssh do?

Exp: ssh -C <ipaddress> ls

in the example it will execute the command : ls , on the remote machine but it wont get loged into the remote machine.

When I check the man of ssh , Its mentioned that this option is for compression/decompression. But here I dont find any compressing/de-compressing.

Can any one clear my doubt??

ssh automatically compresses what is being transmitted. My man pages says this is good if you are using modem lines, but if you have a fast connection, it is slower to compress the file than to just go on and transmit it.

Another place where you would want to use the -C to turn of compression is even on a modem, if the file is already compressed, compressing it again would only get marginal shrinkage, but burn a whole lot of cpu cycles for nothing.

But I dont use this option " -C " for compressing. I use this to execute the command on remote machine.

for exp : if I want to run a command called " ls " on a remote machine called "system1" . I can use the following command:
ssh -C system1 ls
This command will list out the contents of the directory on the remote machine " system1"

But my doubt is how come compression comes into picture?

As awk said, seems -C option has to do with compression,
for remote shell execution you can refere to "rsh" command.

Since you have the option to use SSH 2 protocol it's preferable to use it, rather than insecure rsh command. Your command for listing the remote folder is OK, I use this kind of "automation" every day. The thing with -C flag is that compress all the data that the client sends or receives - so, you invoke a command, there is a data sent to the server, and this data is being compressed on the fly. Since SSH is encrypted by default, it doesn't make sense to use this option at all, plus you have fast network.
One yeah ago I have done performance benchmark against OpenSSH - when using -C flag you actually loose performance, so just don't use it :slight_smile: