Forwarding Internet connection via SSH to a Linux console

2

1

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.

Gadesxion

Posted 2016-12-21T19:32:48.370

Reputation: 21

Answers

2

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 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:

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..

Condor

Posted 2016-12-21T19:32:48.370

Reputation: 55