Centos - Fix slow ssh login


If you've noticed that it takes a significant amount of time to recieve the login prompt when using SSH to access a CentOS server, you can follow the steps below to make it immediate.

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


    Edit the
    file and change GSSAPIAuthentication yes to GSSAPIAuthentication no
    Also change UseDNS to explicitly no by running the following commands/script.
    SEARCH="#UseDNS yes"
    REPLACE="UseDNS no"
    sed -i "s;$SEARCH;$REPLACE;" $FILEPATH
    Then restart the ssh daemon for it to take effect:
    sudo 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