I am LAZY bones? AN ancient AND boring SITE

2008年 06月 27日 的归档

ubuntu下ssh慢的解决办法

在ubuntu下ssh登陆某些服务器,会发生需要等到十来秒才提示输入密码下现象,其实这个是debian做的一个配置上的修改引起的.
ssh_config(5) 的man页上有这样的说明:

Note that the Debian openssh-client package sets several options as stan-
dard in /etc/ssh/ssh_config which are not the default in ssh(1):

o SendEnv LANG LC_*
o HashKnownHosts yes
o GSSAPIAuthentication yes

这个问题正是最后面那项 GSSAPIAuthentication 引起的,打开这个ssh的时候可能会先去尝试其他的认证方式.很多地方都会介绍说修改 /etc/ssh/ssh_config 文件,但是其实这并不是最好的办法,因为在下次升级的时候,也许会因为配置文件被修改过,而引起不必要的麻烦.我的解决办法是修改个人用户的配置文件,如下:
echo “GSSAPIAuthentication no” >> ~/.ssh/config