Sunday, October 17, 2010

ssh ssh-keygen proxy tunnel

Setup is first we connect to host1 then a tunnel from host1 to host2

$ cat ~/.ssh/config
Host host2 i host2
ProxyCommand ssh -q mylogin@host1 nc host2 28 User mylogin

Connect by:
$ ssh i -l mylogin

Copy by:
$ scp myfile.txt mylogin@host2:outfile.txt

Setup RSA keys by
$ ssh-keygen -t rsa

copy ~/.ssh/id_rsa.pub to host2's ~/.ssh/authorized_keys


Using pipes and tar
tar c somefiles*.txt | ssh user1@host1 tar xvp
tar c somefiles*.txt | ssh user1@host1 ssh user2@host2 tar xvp

'pv' command - progress bar view
tar c somefiles*.* | pv -s 75m | ssh user1@host1 tar xp

No comments: