2012年3月1日星期四

SSH登录太慢

从CentOS 6.2用ssh连接Solaris 10很慢,加上-v参数后看到:
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
debug1: An invalid name was supplied
Cannot determine realm for numeric host address
debug1: An invalid name was supplied
debug1: An invalid name was supplied
debug1: Next authentication method: publickey
......
是两个GSSAPI的认证等待失败导致登录很慢。看了Solaris上的sshd_config(4)GSSAPIAuthentication默认打开,CentOS上的ssh_config(5)GSSAPIAuthentication默认也是关闭,但是/etc/ssh/ssh_config中却打开了该选项,这导致ssh尝试了GSSAPI认证。

解决办法很多,要么在服务器端的sshd_config中关掉该选项,要么在客户机的~/.ssh/config或者ssh_config中关掉,或者用ssh -o GSSAPIAuthentication=no来登录。真是:*nix is like a box of chocolate, you never know what you are gonna get.

没有评论:

发表评论