用SSH登陆linux很慢的解决

公司开发服务器66,用ssh登陆时很慢,密码验证大约有二十几秒,我记得以前不是这个样子的。

查找资料后,昭大了解决方案:

vi /etc/ssh/sshd_config

找到

#UseDNS yes

取消注释并改为no即可

 

重新启动ssh

service sshd restart

问题解决。

 

原因摘自网上:

Its your /etc/resolv.conf
i bet if u go to the comp in a web browser its instant, yeah? why? because your PC doesnt do a reverse DNS lookup on ur IP then... when u telnet/ftp into ur linux box, it'll do a dns lookup on you, to see who you are, if u either correct the settings in the /etc/resolve.conf file, or just back it up, then delete the contents all together, it should be fine !

大意是登陆时会根据/etc/resolv.conf中指定的dnsserver进行dns查找。

正常情况下该操作会很快结束,但是最近公司加了上网限制,局域网电脑必须在路由上注册自己的mac才可以上网。66服务器没有在路由上注册mac地址,不能上互联网,所以linux只有等到超时才罢休 。。。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值