Jan
11
不知道为什么这么多年都没遇到啥问题,到了钱厂以后接连遇到3种不同的ssh延迟,觉得有必要记一下了:
1. GSSAPIAuthentication
ssh -vv someserver 可以看到如下类似字样的:
在 ~/.ssh/config(也可以是 /etc/ssh/ssh_config)加上
2. AddressFamily
ssh -vv 在这里卡住的:
加上
3. UseDNS
在server端卡住的(忘了log是啥了),在server的 /etc/ssh/sshd_config 加上
ssh的坑真多,感觉应该抽空整理一个全集,包括之前记录过的 ServerAliveCountMax/ClientAliveCountMax,还有诸如GatewayPorts之类的。
参考:
Fixing SSH login long delay
debug2: ssh_connect: needpriv 0 stuck - Fix.
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
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
GSSAPIAuthentication no
GSSAPIKeyExchange no
2. AddressFamily
ssh -vv 在这里卡住的:
引用
debug2: ssh_connect: needpriv 0
加上
引用
Host *
AddressFamily inet
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.