ssh登陆过慢问题的结果

在登陆服务器的时候总是遇到ssh登陆卡在那里半天的情况出现,使用ssh -vvv进行debug模式之后发现并没有什么明显的异常,或者认证问题的提醒,之后进行google之后找到一篇参考资料 ,总共是提到了两种可能的原因,第一种是由于存在dns反向解析的问题,导致的,这种情况下将服务器端的sshd_config钟的UseDNS选项配置为no之后可以解决dns询问域名卡住的问题,另外一种原因是由于一种多余的认证方式导致的,这个需要在客户端将GSSAPI认证关闭掉即可。原文如下:



There are several things that can go wrong. Add -vvv to make ssh print a detailed trace of what it’s doing, and see where it’s pausing.

The problem could be on the client or on the server.

A common problem on the server is if you’re connecting from a client for which reverse DNS lookups time out. (A “reverse DNS lookup” means getting back from the client machine’s IP address to a host name. It isn’t really useful for security, only slightly helpful to diagnose breakin attempts from log entries, but the default configuration does it anyway.) To turn off reverse DNS lookups, add UseDNS no to /etc/ssh/sshd_config (you need to be root on the server; remember to restart the SSH service afterwards).

Another thing that can go wrong is GSSAPI authentication timing out. If you don’t know what that is, you’re probably not relying on it; you can turn it off by adding the line GSSAPIAuthentication no to /etc/ssh/ssh_config or ~/.ssh/config (that’s on the client side).

转载请注明来源链接 http://just4fun.im/2016/12/20/ssh-e7-99-bb-e9-99-86-e8-bf-87-e6-85-a2-e9-97-ae-e9-a2-98-e7-9a-84-e7-bb-93-e6-9e-9c/ 尊重知识,谢谢:)