2

I want to access some sites and files which I don't have access to on my home computer. However, I can ssh to a remote server which does have the ability to access these sites and files. Is there a way in which I can use the permissions of the remote server to browse the internet on my home computer?

Any help would be greatly appreciated.

njszym
  • 51

1 Answers1

2

Absolutely, this is what the -D option is for:

ssh -D 12345 -N user@host

... will establish a SOCKS proxy that will use the remote server's Internet connection and will be mapped on localhost's port 12345. The -N option is not necessary; it keeps ssh from opening a shell.

Now you have to configure your Internet browser to use that SOCKS proxy.

Maybe it is best to have a profile dedicated to this proxified connection, and use it only when necessary. With firefox you may want to create a special profile, named e.g. "socks", configured to use the SOCKS proxy. You then can call it from the command line with firefox -p socks -no-remote.

There are also Firefox extensions, like e.g. FoxyProxy, that allow you to switch temporarily to a predefined proxified connection to the Internet.

With Chrome (the example below is with the Ubuntu's derivative called chromium), you can also open a temporary browsing session with some special proxy settings, like:

chromium-browser --temp-profile --proxy-server="socks://127.0.0.1:12345"
xhienne
  • 17,793
  • 2
  • 53
  • 69
  • Great, thank you! Is there a simple way to configure the chrome browser to use that proxy through the terminal? I seem to be having trouble with it if I attempt to do so simply through the browser settings. – njszym Mar 25 '17 at 13:15
  • @Nathan I have just updated my answer – xhienne Mar 25 '17 at 13:29