ssh connection speed optimization

1. Turn off UseDNS and GSSAPIAuthentication

  1. What is UseDNS? What is GSSAPIAuthentication?
  • UseDNS yse: The server will first perform a DNS PTR reverse lookup of the client's hostname based on the client's IP address, and then perform a DNS forward A record lookup based on the client's hostname, and verify that it is consistent with the original IP address. This measure prevents the client from cheating.
  • GSSAPIAuthentication yes: GSSAPI-based user authentication, GSSAPI is enabled on the server side by default. When logging in, the client needs to de-analyze the server's IP address. If the server's IP address is not configured with a PTR record, it will get stuck here.
  1. How to close?
echo 'UseDNS no' >>/etc/ssh/sshd_config
sed -i 's/#GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_config
systemctl restart sshd

2. You can use ssh -v to debug

Guess you like

Origin blog.csdn.net/qq_46480020/article/details/113095713