Login in SSH is slow

Aar

Verified User
Joined
Feb 10, 2005
Messages
209
Location
Netherlands
Hello,

When i connect to my server by SSH. The login procedure is slow, when i fill in my password. It takes a a lot of seconds to log in. I know thas a key-phrase is easier, but i'm wondering why it's slow.

I've found the setting 'GSSAPIAuthentication yes'in my sshd_config, and i've changed it to no. After that the login seems fast for a while but now it's slow again... :/
The setting is remaining on 'GSSAPIAuthentication no'
It seems that isn't the trick. :/

What could be wrong?
 
Hello,

The last time I had the same a server reboot solved it. You might try the same.
 
I've rebooted the server, but it is still slow.
SOmetime it takes 30 second after i fill in my password.
 
I believe there is no 100% working solution for such a case, so you need to use all possible debug tools and verbose output in order to diagnose the case.

From man sshd_config:

Code:
 LogLevel             Gives the verbosity level that is used when logging messages from sshd(8).  The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
             The default is INFO.  DEBUG and DEBUG1 are equivalent.  DEBUG2 and DEBUG3 each specify higher levels of debugging output.  Logging with a DEBUG level violates the privacy
             of users and is not recommended.

From man ssh:

Code:
      -v      Verbose mode.  Causes ssh to print debugging messages about its progress.  This is helpful in debugging connection, authentication, and configuration problems.  Multiple
             -v options increase the verbosity.  The maximum is 3.
 
Unless you have already done so, try to disable UseDNS by editing /etc/ssh/sshd_config and set it to: UseDNS no

Then remember to restart sshd
 
I can try that.
But i have heard that CSF / LFD this option had needed to use the bruteforce check?
Is this right?
 
Also, check Your /var/log/btmp size - if there were a lot of invalid login attempts, it can be huge, slowing down logins. Dirty fix:
truncate -s 0 /var/log/btmp
If You use system with systemd, then
systemctl restart systemd-logind
might help.
 
Wow, my btmp is 2,3 GB :eek:
Time to truncate this

Update
Yes, that was the trick! My login is now fast :)
 
Last edited:
Back
Top