Say I have a server inside a dataware house. I can connect to it remotely from my PC but it does not have Internet access.

Is it possible to configure the SSH connection or any other configuration in such a way that the remote server can have Internet connection through my PC ?

2 Answers 2


Yes, use your PC as a proxy. There are many ways to set up a proxy on your PC and there are many ways how the server can access your PC to use that proxy. It all sort of depends what you had in mind. Here two examples.

  • One option is to use openssh on your PC to provide a socks5 proxy for the server to connect to. Server uses ssh with the "-D" switch to connect to your PC. Firefox and others can easily connect to it. This may give you some inside Use socks proxy for commands in terminal

  • A light weight http proxy that I used in the past is tinyproxy. It even runs on TP-Link router with openwrt. Accessing a http proxy is normally even easier than a socks5 proxy, even though a socks5 proxy is more powerful.

Openssh has the advantage that is it preinstalled on basically any linux computer.

  • 1
    Using ssh client (putty) on my PC and sshd on linux server is it possible to do it ? I mean, I already establish a connection from my PC (client) to the remote server. Can I use this connection for the proxy?
    – mquevedob
    Commented Jun 19, 2016 at 23:12

Althogh previous answer is correct, it is not complete, so I thought answering this question myself the way it worked for me so i may help other with the same need. (my PC is windows and my server is Linux)

  1. download and install squid proxy for windows. follow these steps


  2. Use putty to SSH to your linux box before connecting to your linux box, go to Connection->SSH->Tunnels option (if you have a session with your server information saved in putty, remember to load it first) in the "Source port" field enter 3128 in the "Destination" field enter localhost:3128 in the options below, select "Remote" Click "Add" click "Open"

  3. once connected to your remote linux box, enter the following command

    export http_proxy=""

from now on, every wget or curl you execute, it will use your SSH reverse connection to go to the internet through your PC connection.

  1. In case you are using a Linux PC and want to give internet access to your Linux Server, you won't be using putty, but your own ssh client. In this case, edit the file (or create) ~/.ssh/config and enter the following

    Host * ServerAliveInterval 30 RemoteForward 3128 RemoteForward 52698

This will create the reverse connection to your linux PC

I hope this lights up the way to some lost souls as I once was...

  • This option looks promising as well
    – kyrlon
    Commented Mar 21 at 3:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .