Considering security measures, it is possible to change the default SSH Port for the Linux server. I this small tutorial we will be explaining how to change the SSH Port for the Linux servers like Debian, Ubuntu and others.
How to Change the SSH Port in Linux Servers?
Follow the steps one by one…
1. Connect to the server via SSH by root user.
2. Open SSHD_CONFIG
for modification by following command.
nano /etc/ssh/sshd_config
3. Locate #Port 22
.
4. Remove # and change the 22 with desired one.
5. Save edits and Restart SSHD by following command.
service sshd restart
Now we have successfully changed the SSH Port for our Linux server.
All we need to just login with new port, like – ssh user@ip -p port
.
Leave a Reply