Skip to content

Instantly share code, notes, and snippets.

@ardeshireshghi
Created November 16, 2020 11:22
Show Gist options
  • Save ardeshireshghi/6a53961b60f5589c16e64998cb3f0740 to your computer and use it in GitHub Desktop.
Save ardeshireshghi/6a53961b60f5589c16e64998cb3f0740 to your computer and use it in GitHub Desktop.
SSH tunnel socks proxy

ssh -i ~/.ssh/id_rsa -D 1337 -f -C -q -N sammy@your_domain

Explanation of arguments

-i: The path to the SSH key to be used to connect to the host

-D: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025 and 65536)

-f: Forks the process to the background

-C: Compresses the data before sending it

-q: Uses quiet mode

-N: Tells SSH that no command will be sent once the tunnel is up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment