If you use an ssh client (such as putty) to connect to a Linux server, you may wait 10-30 seconds before being prompted to enter a password, which seriously affects work efficiency. The login is very slow, but the speed is normal after login. There are two possible reasons for this situation:

1. DNS reverse resolution problem

OpenSSH will verify the IP when the user logs in. It uses reverse DNS to find the host name based on the user's IP, then uses DNS to find the IP address, and finally matches whether the logged-in IP is legal. If the client's IP does not have a domain name, or the DNS server is slow or unreachable, it will take a long time to log in.

Solution:

Modify the sshd server configuration on the target server and restart sshd.  

Order:

vi /etc/ssh/sshd_config

UseDNS no (add content)

2. Turn off the gssapi authentication of ssh

Use ssh -v user@server to see the following information when logging in:

debug1: Next authentication method: gssapi-with-mic

debug1: Unspecified GSS failure. Minor code may provide more information

Note: ssh -vvv user@server can see more detailed debug information

 

Solution:

Modify the sshd server configuration

vi /etc/ssh/ssh_config

#GSSAPIAuthenticatials  yes  changed to  no

?האם התשובה שקיבלתם הייתה מועילה 0 משתמשים שמצאו מאמר זה מועיל (0 הצבעות)