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.
Best Answer
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:
Now you can point your applications like web browsers to the socks proxy at
127.0.0.1:1080
.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:
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..