The default SSH port is 22. It is strongly recommended to change to more than 10000. So the probability of others scanning to the port is also greatly reduced. How to modify: # Edit/etc/ssh/ssh_config
Vim/etc/ssh/ssh_config
# under Host *, add a new Port value. Take 18439 as an example:
Port 22
Port 18439
# Edit/etc/ssh/sshd_config (ditto 2 figure)
Vim/etc/ssh/sshd_config
#加入新的 Port Value
Port 22
Port 18439
# After saving, restart the SSH service:
Service sshd Restart
# After setting up the firewall, add the port number inside the firewall
Vim/etc/sysconfig/iptables
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 18439-j ACCEPT
#最后重启防火墙
I've set up two ports here, mainly to prevent errors from being modified so that SSH is no longer logged on.
Change your SSH client (for example: Putty) connection port, test the connection, if the new port can connect successfully, then edit the above two files, delete Port 22 configuration.
If the connection fails, the Port 22 is connected and then reconfigured.
After the port setting is successful, note that you should also remove Port 22 from Iptables, add a new configuration of 18439, and restart Iptables.