Problem: When SSH’ing into a server, connection, and login take a long time.
- Connect to a server
- Attempt to log in, and wait to see how long the connection takes.
- 10+ seconds is too long and should be investigated.
- Wait for the password prompt and then proceed to cat /etc/ssh/sshd_config | less
- You’re looking for GSSAPIauthentication. Check to see if it has a yes or no next to it. If it has a yes, then that could be why it’s slow. If it says no, then that isn’t the problem.
- use vi to edit the sshd_config file.
- If you are still in the root directory, then you will need to use the following path vi /etc/ssh/sshd_config
- Once in, find GISSAPIauthenticati and edit it to say “no” instead of “yes”.
- After you have edited the config file, you will need to restart the sshd service.
- Save and Exit Vi editor
- Now, restart ssh with the following command systemctl restart sshd
- Then check the status of SSHD with systemctl status sshd
- Once done, exit and try to reconnect to the server. See if disabling GSSAPIauthentication solved the issue