It's been two weeks that ssh login, logout and using su to other users on a CentOS 6.8 server been very slow, it takes around 20 seconds to 45 seconds for the login or logout or su to take effect. All my other servers are working fine, just three of my servers with same usage been affected by this problem.

In sshd_config the UseDNS and GSSAPIAuthentication are equal to no.

The /var/log/messages and /var/log/secure are empty as well since 2 weeks ago and nothing writes to these two files. The rsyslog.conf is on its defaults configuration and nothing been modified on the configuration file but all of a sudden nothing been writing on these two files.

When I use crontab -e it takes around 15 seconds to open the file, and it's empty.

I tried ssh -vvv user@host from a different system to connect to this problematic server. After I insert the password it waits 30 seconds on the following lines then logs in:

debug3: packet_send2: adding 48 (len 70 padlen 10 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug3: Wrote 144 bytes for a total of 1709
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug3: Wrote 128 bytes for a total of 1837

CPU and Memory usage are all normal on the system. The uptime command shows 16:58:44 up 12 days, 4:21, 5 users, load average: 0.22, 0.23, 0.26.

The disks are fine and there is lots of free space.

Any ideas what's causing the slow ssh login, logout and su?

  • 1
    Might be something in login and logout scripts like ~/.bashrc and ~/.bash_logout (or global ones in /etc). What happens when you try to login using ssh -t <host> bash --noprofile --norc – Lambert Mar 5 at 9:10
  • bashrc and bash_logout and bash_profile are their default values – Ali Golestan Mar 5 at 9:14
  • i used your suggestion but still it takes time to ssh to other server – Ali Golestan Mar 5 at 9:17
  • 2
    Can the host access the configured DNS servers? Is there an NFS export mounted and is quota being checked? – Lambert Mar 5 at 9:18
  • 1
    @roaima this is the result of the uptime command 16:58:44 up 12 days, 4:21, 5 users, load average: 0.22, 0.23, 0.26 the disks are fine and there are lots of free space – Ali Golestan Mar 5 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.