April Personal Metrics

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) :
April Personal Metrics
Save and restart the firewall after modification: /etc/init.d/iptables restart

Modify the remote port:
vi /etc/ssh/sshd_config
April Personal Metrics
After modification:
April Personal Metrics

Save and restart SSH: /etc/init.d/sshd restart

Set to allow only one IP remote:
vi /etc/hosts.deny
(add this command)
April Personal Metrics
save and exit and edit:
vi /etc/hosts.allow
(add this command, save after modification)
April Personal Metrics
Finally restart SSH: /etc/ init.d/sshd restart
done!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325478315&siteId=291194637