标题:解决ssh延迟 出处:Felix021 时间:Mon, 11 Jan 2016 17:29:57 +0000 作者:felix021 地址:https://www.felix021.com/blog/read.php?2155 内容: 不知道为什么这么多年都没遇到啥问题,到了钱厂以后接连遇到3种不同的ssh延迟,觉得有必要记一下了: 1. GSSAPIAuthentication ssh -vv someserver 可以看到如下类似字样的: 引用 debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/krb5cc_1000' not found 在 ~/.ssh/config(也可以是 /etc/ssh/ssh_config)加上引用 Host * GSSAPIAuthentication no GSSAPIKeyExchange no 2. AddressFamily ssh -vv 在这里卡住的: 引用 debug2: ssh_connect: needpriv 0 加上引用 Host * AddressFamily inet 3. UseDNS 在server端卡住的(忘了log是啥了),在server的 /etc/ssh/sshd_config 加上 引用 UseDNS no ssh的坑真多,感觉应该抽空整理一个全集,包括之前记录过的 ServerAliveCountMax/ClientAliveCountMax,还有诸如GatewayPorts之类的。 参考: Fixing SSH login long delay debug2: ssh_connect: needpriv 0 stuck - Fix. Generated by Bo-blog 2.1.0