SSH taking too long to respond?
Disable Group Support System (GSS) login, to do this follow this:
- Log in to the remote server as usual
- Open the SSH configuration (nano /etc/ssh/sshd_config)
- Once inside look for GSS authentication (Ctrl+W, gss, enter)
- Look for the line that says GSS authentication and add a “#” in front of it
- Save and close (ctrl+X, Y, enter)
- Restart the ssh service (service sshd restart or service ssh restart or /etc/init.d/sshd restart or /etc/init.d/ssh restart)
Explanation: SSH can use several different login schemes, password and username, keys, pam/kerberos, gss, etc
What it does is that when you connect to the server it goes one by one trying to see what works, the last one is username and password which is the most regular one, the authentication that takes the most time is with the gss api, since it’s not being used, it can be disabled, thus increasing the speed login works.