linux ssh - GSSAPIAuthentication

【基本介绍】
最近公司搬家,发现合作伙伴的服务器的用ftp工具连接老是timeout。 用linux尝试ssh也相应很久才提示输入密码。

【配置参数】
通过ssh debug发现在尝试gssapi认证的时候会卡很久。
debug2: key: /root/.ssh/id_dsa ((nil))
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information



通常情况下我们在连接 OpenSSH服务器的时候假如 UseDNS选项是打开的话,服务器会先根据客户端的 IP地址进行 DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,并验证是否与原始 IP地址一致,通过此种措施来防止客户端欺骗。平时我们都是动态 IP不会有PTR记录,所以打开此选项也没有太多作用。我们可以通过关闭此功能来提高连接 OpenSSH 服务器的速度。

服务端步骤如下:
编辑配置文件 /etc/ssh/sshd_config
vim /etc/ssh/sshd_config
找到 UseDNS选项,如果没有注释,将其注释
#UseDNS yes
添加
UseDNS no

找到 GSSAPIAuthentication选项,如果没有注释,将其注释
#GSSAPIAuthentication yes
添加
GSSAPIAuthentication no

保存配置文件

重启 OpenSSH服务器
/etc/init.d/sshd restart


【GSSAPIAuthentication】
GSSAPIAuthentication
Specifies whether user authentication based on GSSAPI is allowed. The default is ''no''. Note that this option applies to protocol version 2 only. 



【未知】
后面改回原来的设置,一切又正常了,未知!


【参考引用】
http://www.tuicool.com/articles/JbARR3
http://linux.die.net/man/5/ssh_config

猜你喜欢

转载自runpanda.iteye.com/blog/2164842
今日推荐