Modify the port of the SSH Terminal Service from 22 to another port to prevent attackers from directly guessing your server password
First modify the configuration file
Vi/etc/ssh/sshd_config
Find #Port 221 segment, here is the identity by default using 22 port, modified as follows:
Port 22
Port 5555
And then save the exit
Execution /etc/init.d/sshd Restart
this way the SSH port will work concurrently with the A and the 5555 on.
now edit the firewall configuration: Vi/etc/sysconfig/iptables
Enable the 5555 port.
Execute /etc/init.d/iptables Restart
Now, use the SSH tool to connect to the 5555 port to test for success.
If the connection is successful, edit the sshd_config settings again and delete the Port inside.
The reason is set to two ports, test success and then shut down a port, is to facilitate in the process of modifying the Conf, in case of falling off, network, Misoperation, and other unknown circumstances, but also through another port to connect to debug, so as not to cause more trouble connection.
Tips for modifying SSH remote connection ports for Linux