Expertise level: Easy
Follow this procedure to change your SSH port:
- Login to your server with SSH as root.
- Edit the file /etc/ssh/sshd_config using your favourite text editor.
- Find the line "Port 22" and change 22 to the desired port number (The default ssh port is 22).
- Remove the "#" sign at the beginning of the line (if exist).
The part of the file will look like this:
- Save the file and exit.
- Restart the sshd service:
/etc/rc.d/sshd stop ; /etc/rc.dsshd start