Skip to content

Instantly share code, notes, and snippets.

@ricventu
Last active October 16, 2018 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricventu/33fc3ee05f04589319fe31566482690d to your computer and use it in GitHub Desktop.
Save ricventu/33fc3ee05f04589319fe31566482690d to your computer and use it in GitHub Desktop.
ssh over socks

ssh over socks

Via ssh command line

Create socks

ssh -D 9999 -C <proxy server>

Connect ssh using socks

ssh -o ProxyCommand='nc -x localhost:9999 %h %p' <destination host>

Via ssh config

add to .ssh/config:

Host <destinatin  host>
	User <username>
 	ProxyCommand ssh <proxy host> nc %h %p

then use command:

ssh <destinatin  host>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment