1. Login to the server through SSH (port 22 by default)
2. Type this command vi /etc/ssh/sshd_config
3. Press “i” on the key to enable editing mode.
4. Where it says #Port 22 change to Port 123 (for example)
5. Now pres “esc” button on the keyboard and type :wq! to save the file and press enter.
6. Now restart the SSHd service by typing service sshd restart
PLEASE NOT: IF YOU HAVE A FIREWALL, OPEN THE CUSTOM PORT FIRST BEFORE EDITING, IT MAY LOCK YOU OUT