Centos modifies the remote port and sets the SSH permission to allow only one IP remote login:
If I want to set the remote port to 2222, I must first release this port
command in the firewall as follows:
vi /etc/sysconfig/iptables
(add the 2222 command) :
Save and restart the firewall after modification: /etc/init.d/iptables restart
Modify the remote port:
vi /etc/ssh/sshd_config
After modification:
Save and restart SSH: /etc/init.d/sshd restart
Set to allow only one IP remote:
vi /etc/hosts.deny
(add this command)
save and exit and edit:
vi /etc/hosts.allow
(add this command, save after modification)
Finally restart SSH: /etc/ init.d/sshd restart
done!