I often travel for work, and a few times happened I wasn’t able to access my VPS via SSH on a working internet connection. So I wrote this article to help me remember how to ssh everywhere.
SSH Behind Firewall
In my case, I was not able to use ssh because of a firewall on the guest WIFI network that was blocking port 22.
To use ssh, I did the following: login to my VPS server, and change the port where SSH is running.
Below is the procedure I followed. In my case, I am working on a Mac laptop and my VPS is on VirtualHost.
Verify you can use port 443
Use GitHub server to verify that you are able to connect to their port 443. If this works, you can proceed and set up ssh on your server on port 443. Otherwise, you need a different solution, like a VPN.
Access via Remote Login
DigitalOcean offers a remote console service, that I can use to change on the fly the port on which SSH is running.
Edit sshd_config
nano /etc/ssh/sshd_config
Uncomment the line #Port 22
and transform it into Port 443
.
Save the file and restart the ssh service
sudo systemctl restart ssh
You can now ssh -p 443
to your server.
ssh -T -p 443 myuser@234.345.322.20
References
- Information on SSH: https://www.ssh.com/ssh/
- ssh -p 443 @github: https://help.github.com/en/articles/using-ssh-over-the-https-port
- ssh -p 443 @digitalocean: https://www.digitalocean.com/community/questions/how-to-access-port-22-if-isp-has-blocked-port-22- https://askubuntu.com/questions/394345/ssh-doesnot-work-with-wifi-but-work-fine-with-wired-connection/1145741#1145741
0 Comments