解决SSH登录缓慢

解决方法 第一步:修改SSH服务端配置文件: vim /etc/ssh/sshd_config 第二步:按照下面说明进行修改: - GSSAPIAuthentication yes + GSSAPIAuthentication no - UseDNS yes + UseDNS no UseDNS选项是打开的话,服务器会先根

解决方法

第一步:修改SSH服务端配置文件:

1
vim /etc/ssh/sshd_config

第二步:按照下面说明进行修改:

1
2
3
4
- GSSAPIAuthentication yes
+ GSSAPIAuthentication no
- UseDNS yes
+ UseDNS no
  • UseDNS选项是打开的话,服务器会先根据客户端的 IP地址进行 DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,并验证是否与原始 IP地址一致,通过此种措施来防止客户端欺骗
  • GSSAPIAuthentication 认证很少用到,关闭可以加快SSH访问速度

参考文献


解决SSH登录缓慢
https://www.frytea.com/post/20200903015200.html
作者
Tianlun Song
发布于
2020年9月3日
更新于
2024年6月10日
许可协议