Menu Close

How to move default ssh port to another port in WHM/CPanel VPS

In this tutorial, we will move the default ssh port (22) to another port to prevent or reduce the ssh brute force attempt.
1. Login to your VPS using ssh
2. Move the ssh default port to another port, by editing the following file /etc/ssh/sshd_config :

#Port 22
Port 1156 <-- use the port you have specified / open in the csf configuration(TCP_IN, UDP_IN))
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
ListenAddress 14.18.111.111 <-- this is your VPS IP address

Reboot your VPS from the shell or from SolusVM, and Login again to the shell / ssh using the new port. After moving your default ssh port to another port, at least you can reduce or even prevent the brute force cracking attempt to your vps via ssh

Leave a Reply

Your email address will not be published. Required fields are marked *