SSH登录很慢问题的解决方法

时间:2022-06-01 18:25:45

用ssh连其他linux机器,会等待10-30秒才有提示输入密码。严重影响工作效率.

关闭ssh的gssapi认证

用ssh -v user@server 可以看到登录时有如下信息:

debug1: Next authentication method: gssapi-with-mic

debug1: Unspecified GSS failure. Minor code may provide more information

注:ssh -vvv user@server 可以看到更细的debug信息

解决办法:

在客户端上修改ssh客户端配置(注意不是sshd_conf)

vi /etc/ssh/ssh_config,设置GSSAPIAuthentication no 并重启sshd

可以使用ssh -o GSSAPIAuthentication=no user@server登录

GSSAPI ( Generic Security Services Application Programming Interface) 是一套类似Kerberos 5 的通用网络安全系统接口。该接口是对各种不同的客户端服务器安全机制的封装,以消除安全接口的不同,降低编程难度。但该接口在目标机器无域名解析时会有问题