说明:
近期遇到这个问题,家里的Linux服务连接SSH突然变的很慢,特别是在验证密码的这个环节。
外网远程
很慢这个倒是可以理解,但是在本地连接SSH
也很慢,很奇怪,都没有设置过什么,为什么突然变慢了呢,于是博主想到了sshd_config
里GSSAPIAuthentication
参数,这个到底是个什么作用呢?
据说作用:是否允许使用基于 GSSAPI 的用户认证。默认值为"no"。仅用于SSH-2
进入编辑:shhd_config
博主系统为Centos7:shhd_config
文件在/etc/ssh/sshd_config
系统默认:
GSSAPIAuthentication yes
我们将之修改成GSSAPIAuthentication no
sed -i "s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g" /etc/ssh/sshd_config ###或者使用sed执行
开启秘钥认证的UsePAM yes
系统默认:
#UsePAM yes
我们将之修改成 UsePAM no
或者: echo "UsePAM no" >> /etc/ssh/sshd_config
保存退出,重启sshd
systemctl restart sshd.service
然后重新连接ssh,会发现直接秒连。
版权属于:爱睡懒觉的IT男`s Blog
本文链接:https://hanlee.top/index.php/archives/192/
转载时须注明出处及本声明,谢谢合作!!!