How to Change SSH Port on Ubuntu VPS
Author Credits:
This tutorial was created by Sajan over at EchoTutorials.com. For the convenience of our clients and visitors, we have posted Sajan’s tutorial with his approval and permission.
How to Change SSH Port on a Ubuntu VPS:
To change the SSH port for our Ubuntu server, we’re going to need to edit just once file. So either use vi or nano and open it up.
nano /etc/ssh/sshd_config
In this file file, near the top should be a line that reads…
Port 22
All you need to do is change that 22 to whatever port you want to use for SSH. It’s a good idea to use something completely outside the range of ports used by common and uncommon services and applications. You’ll want to choose some between 49152 and 65535. Then save the file, and restart SSH.
service ssh restart
Close the session and try opening it up again. You’ll notice that port 22 no longer works, you’ll have to configure your client to use the new port you just specified. This is also true for sFTP clients as well.
All URPad.net customers may contact our 24×7 help desk at anytime for further assistance in changing the timezone.
A video tutorial is available at EchoTutorial’s blog post.



A simple change means a lot, I had to re-install a vps once because of a weak password and default ssh port, so I think this blog post is useful for people who are new to linux based servers, thanks!