1. Add a port
Vim/etc/ssh/sshd_config
Remove the comment of # Port 22 and add the line feed to Port 443.
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.
443 is actually the port used by https, and 3128 is the port used by squid. 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 443
Vi/etc/sysconfig/iptables
Add-a input-m state-state NEW-m tcp-p tcp-dport 443-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
Successful!