首页 > 其他 > 详细

SSH的优化

时间:2015-11-13 19:15:11      阅读:296      评论:0      收藏:0      [点我收藏+]



###修改端口

grep Port /etc/ssh/sshd_config
sed -i ‘/#Port 22/aPort 52113‘ /etc/ssh/sshd_config
grep Port /etc/ssh/sshd_config

###禁止root用户登录

grep ‘PermitRootLogin yes‘ /etc/ssh/sshd_config
sed -i ‘/#PermitRootLogin yes/aPermitRootLogin no‘ /etc/ssh/sshd_config
grep ‘PermitRootLogin‘ /etc/ssh/sshd_config

###禁止空密码登录

grep ‘PermitE‘ /etc/ssh/sshd_config
sed -i ‘/#PermitEmptyPasswords no/aPermitEmptyPasswords yes‘ /etc/ssh/sshd_config
grep ‘PermitE‘ /etc/ssh/sshd_config

##优化 ssh连接过慢,DNS轮询导致的问题:

grep ‘UseDNS‘ /etc/ssh/sshd_config
sed -i ‘/#UseDNS yes/aUseDNS no‘ /etc/ssh/sshd_config
grep ‘UseDNS‘ /etc/ssh/sshd_config

###GSSAPIAuthentication,这个作用是为了时ssh连接更加快

grep ‘GSSAPIAuthentication‘ /etc/ssh/sshd_config
sed -i ‘s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g‘ /etc/ssh/sshd_config
grep ‘GSSAPIAuthentication‘ /etc/ssh/sshd_config


SSH的优化

原文:http://lvnian.blog.51cto.com/7155281/1712524

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!