SSH and SFTP tunnels via ProxyCommand
Recently on CyberCity nice article appeared about using middle server to connect to our destination servers. Most of servers have firewalls which allow connect only from given pool of IP addresses. So tunnelling is very useful as long we are using it in smart way.
Quick round up of vivek’s article
SFTP connection with ProxyCommand
sftp -o 'ProxyCommand=/usr/bin/ssh username@middle.server.com -p 66 /usr/bin/nc %h %p %r' username@destination.server.com
Just be awere that we are not using standard SSH 22 port – it’s 66
SSH tunnel with ProxyCommand
nano ~/.ssh/config
Host nickname HostName destination.server.com User username ProxyCommand /usr/bin/ssh username@middle.server.com -p 66 /usr/bin/nc %h %p %r
to connect you just type ssh nickname