Skip to content

Instantly share code, notes, and snippets.

@zjhuntin
Created August 10, 2018 13:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zjhuntin/0e77eeb1d693828fb299edae501a1eeb to your computer and use it in GitHub Desktop.
Save zjhuntin/0e77eeb1d693828fb299edae501a1eeb to your computer and use it in GitHub Desktop.
Socks!
This is a basic example of using SOCKS.
From the computer you want to browse on you'll make an ssh connection to the computer you want to browse from.
In this example it'll be my laptop connecting to my desktop.
Run: ssh -D <port, I use 10000> <user>@<hostname of desktop>
Now, in a browser you don't normally use (I'm using firefox), go to network proxy.
Set Manual porxy configuration
Under Socks host use localhost and set the port for the port you used in the ssh command.
Make sure it's set for SOCKS v5.
Check the "Proxy DNS when using SOCK v5"
Click OK
You're good to go!
@johnpmitsch
Copy link

For an example, this is what I do to use a SOCKS proxy on my laptop to access VMs on my workstation:

  • ssh command on laptop to bind to port 30000. I use 40000 as ssh port so you won't need the -p if you use the default 22
    ssh -p 40000 -D 30000 -q -C -N jomitsch@$HYPERVISOR
  • use this config in firefox
    image
  • then I can access my workstation VMs by their hostnames (like centos7-devel.example.com) in firefox

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