+--------+ +----------+ +----------+ | local | --------> | bastion |----------->| server | | | | 1.2.3.4 | | 5.6.7.8 | +--------+ +----------+ +----------+
ssh -oProxyCommand='ssh -W %h:%p 1.2.3.4' 5.6.7.8 ssh -oProxyCommand='ssh -W %h:%p user01@1.2.3.4' user01@5.6.7.8
Host bastion HostName 1.2.3.4 Host server HostName 5.6.7.8 Port 22 ProxyCommand ssh -W %h:%p bastion
ssh server scp file server:/tmp rsync dir1/ server:/tmp/dir1/
Host bastion HostName 1.2.3.4 Host server HostName 5.6.7.8 Port 22 ProxyCommand ssh bastion nc %h %p
scp -o 'Proxycommand=/usr/local/bin/connect/connect -h 192.168.0.10 -p 9999' tmp.txt testuser@xx.xx.xx.xx:/tmp/
Host test-server1 HostName xx.xx.xx.xx IdentityFile ~/.ssh/id_rsa-test.pub User testuser01 ProxyCommand connect -H xx.xx.xx.xx:9999 %h %p
$ wget http://www.meadowy.org/~gotoh/ssh/connect.c $ gcc connect.c -o /usr/local/bin/connect/connect