Centos - Fix slow ssh login


I'm a very impatient person. Today I decided I would fix this slow login problem that plagues CentOS that I just dont get with Ubuntu. I don't know what the consequences are, no doubt horribly horrendous (feel free to let me know in the comments), but for now here is my solution.

Please note that testing/development of this material was done with a minimal net install of Centos 6.3

To 'diagnose' the problem, simply run this command
ssh -vvv root@my-centos-servers-ip
You should get output like this before it delays for a long time and eventually gives you a screen asking for your password:

It appears there is a problem with GSS authentication, which to disable, you simply edit the /etc/ssh/sshd_config file.
vi /etc/ssh/sshd_config
Change GSSAPIAuthentication yes to GSSAPIAuthentication no, either by replacing the text in the uncommented section, or switch the comments like I have done so below:
Then restart the ssh daemon for it to take effect:
service sshd restart
That was it! Now you can exit your ssh connection before relogging in and you will notice that you get an immediate request for your password.


Delayed SSH login on Centos 6

No comments:

Post a Comment