centos7 xshell连接慢的问题

📅 2026/7/9 1:38:09 👁️ 阅读次数 📝 编程学习
centos7 xshell连接慢的问题

为什么xshell连接centos7 会比较的慢呢?

  • 主要就是ssh默认开启了dns反向解析与GSSAPI认证,这2个会在虚拟机环境中超时等待,centos8 默认已经关闭了这些耗时的机制
# 1. 备份配置
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak# 2. 关闭两个耗时项
sed -i 's/^#*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
sed -i 's/^#*GSSAPIAuthentication.*/GSSAPIAuthentication no/' /etc/ssh/sshd_config# 3. 验证开是否修改对?
[root@kvm ~]# grep -E 'UseDNS|GSSAPIAuthentication' /etc/ssh/sshd_config
GSSAPIAuthentication no
UseDNS no# 4. 重启 sshd
systemctl restart sshd

img

非常迅速的就弹出来这个身份验证