Changing the SSH port is a necessary operation for server security. The default port 22 that comes after installation, or frequently used SSH ports, are continuously scanned by bots. We
recommend that you do not use well-known or default ports to prevent your server from being hacked.
To change the port, after logging into the server via SSH;
nano /etc/ssh/sshd_configwe open the file containing the SSH settings
with this command. In this file, there will be information indicating the port as shown below.

You can change the #Port 22 section here to a port you will not forget. Make sure the new port you enter is not a frequently used or well-known port. After making the
change, you can save and exit the file with the CTRL+X and then Y key combination. Finally, you need to restart the sshd service for the port setting to become active.
/etc/init.d/sshd restart
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!