Did you know that you can navigate the posts by swiping left and right?
The default port for SSH is blocked in the campus and it forces one to use a lot of workarounds to do simple SSH tasks; one such task is exposing a PC inside campus network for SSH by a PC outside the campus network.
I recently had to do the hardwork and this article shows the steps I used for the same. This will be based on Debian (and Ubuntu) users but the steps, more or less remain the same throughout.
OpenSSH server allows creating an SSH service that allows other computers to connect to your PC via SSH. OpenSSH can be setup using the following commands:
sudo apt-get install openssh-server
Once the server is installed, follow the below instructions:
sudo gedit /etc/ssh/sshd_config
port 22and change it to port 443
sudo systemctl restart ssh
sudo systemctl status ssh
NOTE: The below command should install openssh client on the PC you are trying to connect from.
sudo apt-get install openssh-client
It is highly recommended to create a new user for SSHing into your system. The same can be done on Ubuntu by the following steps:
We will be using “testname” as username and “testpass” as password for further purpose.
We will be using ngrok to expose port 443 so that it can be connected from outside. This is required since we are behind a proxy and hence there is no public IP address for each PC but a common public IP. The below commands install and expose port.
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip unzip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip ./ngrok tcp 443 --authtoken [AuthToken]
NOTE: AuthToken can be generated by signing up for a free account on ngrok. More information is present here.
Once the above command is run, you’ll see a screen like below.
tcp://0.tcp.ngrok.io:16960 is your public IP address.
Now, on the client PC do the following.
ssh testuser@tcp://0.tcp.ngrok.io:16960 -p 443
You’ll be prompted for the password and voila! You are into your PC inside the campus network.