Article Title: solutions to slow ssh logon in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I believe many of my friends have abandoned telnet rlogin or X-window for security reasons when using the Linux system, and used openssh as their default remote logon method.
However, it is often the case that telnet to the server is fast, but the ssh connection is slow. It takes about half a minute or longer. Ping speed is also very good, people mistakenly think that the ssh connection is not good.
The following describes how to solve this problem,
The most common reason is that the server's sshd will go to the DNS to find the hostname for accessing the client IP address. If the DNS is unavailable or there are no relevant records, it will take a lot of time.
1. Add the ip address and hostname of your local machine to the/etc/hosts file on the server.
2. modify or add UseDNS = no to the/etc/ssh/sshd_config file on the server.
3. Comment out all rows in/etc/resolv. conf on the server.
4. Modify hosts in/etc/nsswitch. conf on the server to hosts: files.
5. reboot server to make the configuration take effect
In addition
Authentication gssapi-with-mic
There may also be problems. Modify GSSAPIAuthentication no in the/etc/ssh/sshd_config file on the server.
/Etc/init. d/sshd restart sshd process to make the configuration take effect
If the above two methods do not solve the problem, we are good at using the debug mode ssh-v to view the log, find the process with the longest suspension time, and then modify the configuration accordingly.