Question

I am really struggling with this.

My host (A) is behind a proxy/firewall (PF) and needs to connect to host H.

The proxy has HTTP/FTP/SOCK proxy configured and I have no issue to configure in web browser, wget etc.

But when I use...

ssh H //to connect my host 

I have no success to pass over the proxy. It seems to try to connect directly instead of going via the PF.

I am using Ubuntu 12.10.

Was it helpful?

Solution

Check the docs for the ssh ProxyCommand option. You can specify a command to run (for example, nc) to connect to a given host and port. For example, adding this to your .ssh/config might work to traverse a SOCKS5 proxy:

ProxyCommand nc -x MY_PROXY_HOST:MY_PROXY_PORT %h %p

More detailed instructions are going to depend on your environment.

OTHER TIPS

There are several ways to do it. You can use nc or try wrappers like corkscrew. I'll describe way with wrapeer:

Firstly install corkscrew by apt-get
Then you need to specify ProxyCommand in your ./ssh/config file (replace example-proxy.com and 8080 with your proxy host and port):

Host *
  ProxyCommand corkscrew example-proxy.com 8080 %h %p ~/.ssh/proxyauth

Your login credentials should be in ~/.ssh/proxyauth in format:

login:password
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top