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"