ssh 连接缓慢原因以及解决方法

341次阅读
没有评论

共计 394 个字符,预计需要花费 1 分钟才能阅读完成。

【问题】
通过 SSH 服务远程访问 Linux 服务器,总是等待很久才能登陆。

【分析 & 解决】
1、SSH 服务默认启用了 DNS 反向解析的功能

# 关闭

sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config

# 另外在 authentication gssapi-with-mic 也有可能出现问题,在 server 上 /etc/ssh/sshd_config 文件中修改 GSSAPIAuthentication no
# 参数解说:服务器端启用了 GSSAPI。登陆的时候客户端需要对服务器端的 IP 地址进行反解析,如果服务器的 IP 地址没有配置 PTR 记录,那么就容易在这里卡住了。

sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/sshd_config

重启 SSH 生效

systemctl restart sshd
打赏小哥

ssh 连接缓慢原因以及解决方法 微信打赏 ssh 连接缓慢原因以及解决方法 支付宝打赏

正文完
 0
评论(没有评论)