College WiFi: Accessing Home Computer via SSH Proxy
In this article, we will discuss how to access your home computer securely using SSH (Secure Shell) while connected to your college's WiFi, which requires a proxy. By setting up an SSH tunnel, you can securely access resources on your home computer, such as files, applications, and network services, as if you were directly connected to your home network.
Prerequisites
- A computer at home running an SSH server, such as OpenSSH on Linux or macOS, or a Windows SSH server like OpenSSH for Windows or Cygwin.
- Access to your college's WiFi network with proxy settings.
- An SSH client installed on your laptop or device, such as OpenSSH (built-in for Linux and macOS), PuTTY for Windows, or a mobile SSH client for iOS or Android.
Setting up an SSH Server at Home
First, ensure that you have an SSH server running on your home computer. Here's how to set up an SSH server on various operating systems:
- Configure SSH keys for authentication on Linux, macOS, or Windows.
- Install and configure OpenSSH server on Ubuntu 18.04 or other Linux distributions.
- Install OpenSSH on Windows Server 2019 or other Windows versions.
Configuring SSH Client for Proxy Access
Next, configure your SSH client to use your college's WiFi proxy settings. We'll use the OpenSSH client as an example:
For Linux and macOS:
Edit the /etc/ssh/ssh_config file with your favorite text editor (e.g., nano, vim, or emacs) and add the following lines:
Host *
ProxyCommand nc -X 5 -x : %h %p
Replace and with your college's WiFi proxy host and port.
For Windows (using OpenSSH for Windows or Cygwin):
Create a new file called config in the C:\Users\YourUsername\.ssh directory (create the directory if it doesn't exist) and add the following lines:
Host *
ProxyCommand nc.exe -X 5 -x : %h %p
Replace and with your college's WiFi proxy host and port.
Setting up an SSH Tunnel
Now that your SSH client is configured for proxy access, you can set up an SSH tunnel. Open a terminal or command prompt and run the following command:
ssh -L :: @
Replace the following:
: The local port on your laptop or device that will forward traffic to your home computer (e.g., 8080).: The address of your home computer on your home network (e.g., 192.168.1.100).: The port of the service on your home computer you want to access (e.g., 80 for HTTP, 443 for HTTPS, or 22 for SSH).: Your SSH username.: The address of your SSH server at home (e.g., your home router's public IP address or a dynamic DNS address).
For example:
ssh -L 8080:192.168.1.100:80 [email protected]
You will be prompted to enter your SSH password. Once authenticated, the SSH tunnel will be established.
Accessing Your Home Computer
To access your home computer, open a web browser or another application on your laptop or device and use the following URL or address:
http://localhost:/
Replace with the local port you specified when setting up the SSH tunnel (e.g., 8080).
- Configure an SSH server at home.
- Configure your SSH client for proxy access.
- Set up an SSH tunnel to forward traffic to your home computer.
- Access your home computer using the local address and port.