Tuesday 9 December 2008

ssh sftp from behind firewall via HTTP proxy

If you work in corporate network that is behind firewall.

if you try this:
chris@emeadb:~$ sftp username@xx.xx.xx.xx
Connecting to xx.xx.xx.xx...
ssh: connect to host xx.xx.xx.xx port 22: No route to host
Couldn't read packet: Connection reset by peer

With help comes connect-proxy
Install it with (in debian like systems):
sudo apt-get install connect-proxy

then configure it:
vi ~/.ssh/config

adjust to your needs the content:
Host *
ProxyCommand connect-proxy -H <IP or FQDN of your proxy>:<port> %h %p

enjoy:
chris@emeadb:~$ sftp username@xx.xx.xx.xx
Connecting to xx.xx.xx.xx...
Secure SFTP Serverusername@xx.xx.xx.xx's password:

No comments: