SSH through SOCKS proxy

Hi.

I’ve encountered the need to SSH from my machine to the Internet.
Unfortunately, it had to be through a SOCKS proxy.

Googling gave me a lot of tips how to -create- a SOCKS proxy with SSH, but it was much harder to find information how to -use- a SOCKS proxy with SSH.

Summing it all up:

compile this:
http://savannah.gnu.org/maintenance/connect.c

put it in somewhere in your PATH,

and try something like this:
ssh -v -o ProxyCommand="connect -S my.socks.proxy.com %h %p" git@github.com

(pay attention to NOT use socks://my.socks… format)

if it works, you can make this configuration permanent:
echo .*: >> ~/.ssh/config
echo ProxyCommand="connect -S my.socks.proxy.com %h %p" >> ~/.ssh/config

And now just:
ssh git@github.com

Advertisements

Leave a comment

Filed under Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s