1. add the port vim/etc/ssh/sshd_config and remove the comment of # Port22 and add the line feed to Port57788. if the comment is added but the comment is modified, we recommend that you keep port 22 first, and then remove the new port. We recommend that you use a large port, such as 10000 ~ More than 65535. Restart the SSH service/etc/init. d/sshdrestart
1. add a port
Vim/etc/ssh/sshd_config
Remove the comment of # Port 22 and add the line feed to Port 57788.
If you want to add but modify the port number, we recommend that you keep port 22 and wait until the new port can be logged on and removed.
We recommend that you use a large port, such as 10000 ~ More than 65535.
Restart the SSH service/etc/init. d/sshd restart
2. enable firewall Port 57788
Vi/etc/sysconfig/iptables
Add-a input-m state? State NEW-m tcp-p tcp? Dport 57788-j ACCEPT
Restart firewall/etc/init. d/iptables restart
3. Shield the default port
It is recommended that the default port 22 be blocked after the new port can be used.
Vi/etc/sysconfig/iptables
In
-A RH-Firewall-1-INPUT-m state? State NEW-m tcp-p tcp? Dport 22-j ACCEPT
Comment out the prefix #
Restart firewall/etc/init. d/iptables restart
Finished.