【Linux】ssh连接内网服务器速度缓慢
问题描述:
使用 SSH命令行 或者 xshell工具 连接内网服务器,卡在如下图状态很久才能连接上。
解决方法:
-
登录所要连接的服务器后,打开并修改 /etc/ssh/sshd_config 文件:vim /etc/ssh/sshd_config
- 修改 GSSAPIAuthentication yes 为 GSSAPIAuthentication no;
- 修改 UseDNS yes 为 UseDNS no(其中如果没有 UseDNS yes 这一行代码则在 UsePAM yes 代码后添加一行,如下图所示);
- 重启sshd服务:service sshd restart
- 查看服务状态:systemctl status sshd.service
此时再打开xshell,试着连接Linux,速度明显加快许多(几乎秒连)。