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.
WARNING: Make sure the new SSH Port does not conflict with any known or blocked ports like 80, 443.
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.
SSHD_CONFIG for modification by following command.
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.