2015年12月17日 星期四

限制SSH IP 及修改port

vi /etc/hosts.allow

sshd:192.168.0.100:allow
sshd:192.168.0.*:allow                   //允許單一IP或網段
sshd:all:deny                                 //擋全部

centos5
service sshd restart

centos7
systemctl restart sshd

修改port

vi /etc/sshd/sshd_config