ssh连接速度优化
作者:互联网
1. 关闭UseDNS和GSSAPIAuthentication
- 何为UseDNS? 何为GSSAPIAuthentication?
- UseDNS yse : 服务器会先根据客户端的 IP地址进行 DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,并验证是否与原始 IP地址一致,通过此种措施来防止客户端欺骗。
- GSSAPIAuthentication yes : 基于 GSSAPI 的用户认证,服务器端默认启用了GSSAPI。登陆的时候客户端需要对服务器端的IP地址进行反解析,如果服务器的IP地址没有配置PTR记录,那么就会在这里卡住。
- 如何关闭?
echo 'UseDNS no' >>/etc/ssh/sshd_config
sed -i 's/#GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_config
systemctl restart sshd
2. 可以使用ssh -v进行debug
标签:sshd,UseDNS,GSSAPIAuthentication,ssh,IP地址,优化,连接,客户端 来源: https://blog.csdn.net/qq_46480020/article/details/113095713