SSH Tricks

SSH compression

To use SSH with compression blowfish (this is the fastest for me), I can do

ssh -X -C -c blowfish-cbc remotemachine

SSH without password

In a terminal, input

ssh-keygen

to generate key. Then copy the key to the "remotemachine",

ssh-copy-id "remotemachine"

Then just input

ssh "remotemachine"

to get to the "remotemachine' without password.

Double SSH Tunneling

The "remotemachine" is the workstation I want to work on, and the "gateway" is a bridge machine connecting my local machine and the "remotemachine".

In a terminal, input

ssh -L10212:remotemachine:22 gateway

In another terminal, to get connected to the "remotemachine", just input

ssh localhost -p 10212

To clone a Mecurial repository, input

hg clone -e 'ssh -p 10212' ssh://localhost//pathtofolder

where "pathtofolder" is the location of the Mecurial repository.

To pull from a Mecurial repository, input

hg pull -e 'ssh -p 10212 -l username' ssh://localhost//pathtofoler