一、 修改SSH配置文件

# 编辑SSH配置文件
vim /etc/ssh/sshd_config

# Linux默认开启反向DNS解析,会比较耗时,需要关闭
UseDNS=no

# 关闭GSS认证
GSSAPIAuthentication no

# 重启SSH服务
sudo systemctl restart sshd.service

二、定位SSH连接卡顿的位置

[xiao@localhost ~]$ ssh -v xiao@192.168.174.149
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
...
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address
debug1: Unspecified GSS failure.  Minor code may provide more information
Cannot determine realm for numeric host address

根据上面输出的日志:ssh链接卡在GSS认证那一步

Logo

更多推荐