Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want max compression on my ssh tunnel cos I'm on a dialup line ;)

At the man page can one can read:

CompressionLevel .....The meaning of the values is the same as in gzip(1). Note that this option applies to protocol version 1 only.

What if I want max compression rate and while using ssh version 2?

How know the protocol version I'm using?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

To know the protocol version of ssh, you can include -v option in your ssh command.

To request compression, you can use -C option. This should work even for protocol version 2.

share|improve this answer
    
But what about CompressionLevel option? I don't want use the default level, 6, but the 9 cos I'm over a diulup connection. –  gsc-frank May 13 '12 at 14:54
    
@frankabel: As I understood from the manual, you can only set the compression level for protocol version 1, but I am not sure about this. –  Khaled May 13 '12 at 14:56
1  
Bad news, here lists.mindrot.org/pipermail/openssh-unix-dev/2003-November/… I found that ssh2 is less capable than ssh1 regards compression configuration. –  gsc-frank May 13 '12 at 15:17
1  
Seem to me that if want use max compression level (9), I must use ssh 1 instead of ssh 2 –  gsc-frank May 13 '12 at 15:22
6  
Just leave it at the default and use ssh2. The difference isn't much, and the security gain from using v2 is worth it. –  Bill Weiss May 13 '12 at 15:26
add comment

Depending on your use case, you might want to utilize pipes in order to achieve higher compression levels for certain streams.

ssh ${SSH_USER}@${SSH_HOST} "
    echo 'string to be compressed' | gzip -9
" | zcat | echo -

The above example compresses the string/stream on the remote side (gzip) and decompresses it upon receipt on the local side (zcat).

Note that ssh's compression is off on intention. Only the pipe's compression is used.

You may use other compression tools like bz2 or xz as well. Consider their respective performance impacts.

NOTE: It seems that, if the compression uses a very slow algorithm, the stream can fail to deliver in time and the connection "closes" with an error.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.