Skip to content

Instantly share code, notes, and snippets.

@hosni
Created November 13, 2022 17:36
Show Gist options
  • Save hosni/5e0347cc8b99e44791e64bc46f54ae80 to your computer and use it in GitHub Desktop.
Save hosni/5e0347cc8b99e44791e64bc46f54ae80 to your computer and use it in GitHub Desktop.
ssh using socks5 proxy
We need to use ProxyCommand option of ssh client like this:
`ProxyCommand /usr/bin/nc -x SOCKS5_PROXY_HOST:SOCKS5_PROXY_PORT %h %p`
The ssh command is something like this:
ssh SSH_USER@SSH_HOST -o "ProxyCommand /usr/bin/nc -x SOCKS5_PROXY_HOST:SOCKS5_PROXY_PORT %h %p"
for example:
ssh -T git@github.com -o "ProxyCommand /usr/bin/nc -x 127.0.0.1:9050 %h %p"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment