Custom SSH port in Linux Server
Changing the SSH port to a custom one will increase security. This can be performed by changing the default value assigned to the directive “Port” in the configuration file /etc/ssh/sshd_config
Once the modification is completed, restart the sshd server and check whether you are able to connect to the new port.
You can check it using the following command
$ telnet 192.168.1.105 22666
Connected to 192.168.1.105
Escape character is ‘^]’.
Once you are able to connect, login to the server and confirm everything is working. Don’t close the current shell until the modification is confirmed to be working. Otherwise you might get locked out from the server.