SSH over SOCKS proxy

Step-by-Step descriptions of how to do things.

SSH over SOCKS proxy

Postby ^rooker » Wed May 31, 2017 3:40 pm

In order to connect to SSH over a SOCKS proxy server, you can use the following command:
Code: Select all
$ ssh -o ProxyCommand='nc -x myproxyserver.example.com:1080 %h %p' myuser@targetsshserver.example.com

You need to change the hostnames of the proxy- and ssh-server, as well as port and username to match your setup.
(Thanks to Captain Obvious for pointing that out ;))

Here is the same connection as .ssh/config example:
Code: Select all
Host mysshserver
    Hostname targetsshserver.example.com
    User myuser
    ProxyCommand nc -x myproxyserver.example.com:1080 %h %p


Successfully tested and used on Xubuntu 16.04.1 (Xenial Xerus) - ssh client v7.2.

Thanks to the posting 'SSH via SOCKS proxies' (by Jethro Carr).
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
 
Posts: 1444
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0

Return to HowTo's

Who is online

Users browsing this forum: No registered users and 1 guest

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: No registered users and 12 guests

Reputation System ©'