四月个人指标

centos修改远程端口,设置SSH权限只允许一个IP远程登录:
如果我要把远程端口设置成2222的话要先在防火墙中放行这个端口
命令如下:
vi /etc/sysconfig/iptables
(添加2222那段命令):
四月个人指标
修改后保存重启防火墙:/etc/init.d/iptables restart

修改远程端口:
vi /etc/ssh/sshd_config
四月个人指标
修改后:
四月个人指标

保存重启SSH:/etc/init.d/sshd restart

设置只允许一个IP远程:
vi /etc/hosts.deny
(添加这条命令)
四月个人指标
保存退出后在编辑:
vi /etc/hosts.allow
(添加这条命令,修改后保存)
四月个人指标
最后重启SSH:/etc/init.d/sshd restart
完成!

猜你喜欢

转载自blog.51cto.com/13732077/2113255