Troubleshooting Linux SSH Login Slow

Source: Internet
Author: User

There are two reasons for SSH logon slow: DNS reverse resolution problem and SSH GSSAPI authentication1: SSH GSSAPI authentication problem Gssapi (Generic Security Services application Programming Interface) is a set of Kerberos-like5Common network security system interface. This interface is a package of different client server security mechanisms to eliminate the different security interfaces and reduce programming difficulty. However, this interface has problems when the target machine has no domain name resolution by default, Gssapiauthentication is activated on both the server side and the client. If there is a problem with the DNS service, the logon process waits until the DNS query times out before it can continue, which is why the SSH logon prompt waits a long time to appear. Why is the DNS parsing service used during SSH login? This is the reason why the GSSAPI authentication method is needed. So in the configuration file/etc/ssh/sshd_config (server) or/etc/ssh/ssh_config (client) set the parameter gssapiauthentication to No to resolve the problem of SSH login slow. 2: The problem of DNS reverse resolution OPENSSH the IP when the user logs on, it uses reverse DNS to find the hostname based on the user's IP, then uses DNS to find the IP address, and finally matches the logon IP is legitimate. If the client's IP does not have a domain name, or if the DNS server is slow or not, logging in will take time. 1: Add the usual IP and hostname to the/etc/hosts file on the server, and then in the/etc/nsswitch.conf See if the program queries the hosts file first2: Modify or add usedns= to the/etc/ssh/sshd_config file on the serverNo. Then restart the sshd service ./etc/ssh/sshd_config set Usedns to No, restart the sshd service, and then test the SSH connection speed. Sure enough, to connect quickly. It seems that the main problem is DNS reverse resolution.

Troubleshooting Linux SSH Login Slow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.