I have a remote server which is behind a firewall that blocks access to the Internet. I would like to forward my local Internet connection via SSH (putty) to a CLI session on the remote Linux server.

For example I can not run yum update without the Internet connection. I would like to know how to set up a tunnel that will forward my local machine Internet access to a remote terminal.

I have seen tutorials on how to set up a proxy to use a browser, but I am not sure how to go about forwarding Internet to a terminal.


1 Answer 1


As long as your client can SSH to the server, there's really not much you can't do - provided that the server doesn't block ports.

With dynamic port forwarding you can create a socks5 proxy on localhost, using something like this:

ssh -NTf -D 1080 user@server

Now you can point your applications like web browsers to the socks proxy at

Another tool you could consider is sshuttle. To tunnel all your web traffic (including those programs that don't support proxies like package managers) you can use a command like this:

sshuttle -r user@server 0/0

Also consider asking the sysadmin there to just open the appropiate ports, as they may not be pleased with users attempting to bypass their firewall rules..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.