Today we will be setting up Dynamic port forwarding, one form of SSH tunneling. This procedure is applicable if we have a computer without Internet access, but has network access to a computer that does have Internet access (i.e. lab environments), and we don’t have a Hotspot or wi-fi access to a cell phone that can tether.
Definitions:
- Client PC: The lab computer with no Internet access
- Server PC: The computer with Internet access. In this example, the server is Windows-based.
Client PC Setup
- If the client needs a current browser, we can download full installs of Firefox at the below link. We can then copy the full install to the client and install it. https://www.mozilla.org/en-US/firefox/all/#product-desktop-release. Alternately google “firefox offline install” if the link doesn’t work. Firefox has better control of proxy settings than Chrome, so it is preferred in this situation.
- Set up a temporary proxy session in Firefox, which will work until we can install FoxyProxy:
- From Firefox Settings → type “proxy” in search bar and select the “Settings” button under Network Settings
- Select Manual proxy configuration radio button
- Under SOCKS Host, enter “localhost” and set port to 1080
- Click OK
- Download plink.exe, which is a command line ssh client from the creators of Putty, and copy it to the client PC. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Server PC Setup
- If you have the admin privileges and licensing available you can use Microsoft OpenSSH Server.
- Otherwise, download and install Bitvise SSH Server.
https://www.bitvise.com/ssh-server-download
- Bitvise Setup:
- Make sure the Bitvise Server is running. From the Server tab, I changed the Startup Type to Manual so that the Server isn’t always running when I don’t need it to be.
- Note the IP address and login creds of the server PC. In my case the IP address is 10.209.233.51 and the login is administrator.
Dynamic Port Forward
- From a command prompt on the client PC, change to the folder that contains plink.exe and enter:
c:\temp>plink -ssh -D 127.0.0.1:1080 administrator@10.209.233.51
- Type the password and hit Enter. Hit Enter again to begin the session.
- You should now have Internet access.
- As I mentioned above, you can now install the FoxyProxy browser extension in Firefox, which makes it much easier to toggle proxy servers on and off.