Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In recent weeks, login times on my Ubuntu server have started timing out; both through SSH and the local command line console. Examination of the /var/log/auth.log files yields nothing interesting.

How can I diagnose long log in times on my Ubuntu server?

I should mention, also, that no updates have been performed since the problem has started, and that the /, /boot/ and /usr/ file systems are mounted as readonly.

[Edit] This is a stand alone machine, so it doesn't authenticate with Active Directory, LDAP etc. Also, the login prompt is responsive, as is the password prompt. Upon typing the password then CR, I'll timeout. After four a five tries, I will be able to login, although I'm worried this will start taking longer.

share|improve this question
    
Is this a GUI desktop login, or console/ssh login? –  sysadmin1138 Feb 3 '11 at 21:43
    
Where are your user accounts stored? Locally in /etc/passwd? LDAP? Kerberos? Active Directory? NIS/YP? –  Mikel Feb 3 '11 at 21:47
    
@sysadmin1138: Not a GUI, I thought I was clear about it being SSH and a console, I added "command line" in front of console. –  Jamie Feb 3 '11 at 21:53
    
@Mikel: It's a stand alone server, so /etc/passwd. –  Jamie Feb 3 '11 at 21:54

4 Answers 4

Quite often this is due to a reverse DNS lookup of your host IP.

Make sure your client IP has a reverse IP DNS record.

See this link for more details of a work around if setting up reverse records is out of your sphere of influence.

share|improve this answer
1  
I'm not too keen on trying this for two reasons: only recent this has come about, and the sshd_config file has been static for months, and secondly, this also happens when I'm logging in on the local console (no ssh). –  Jamie Feb 3 '11 at 22:26
    
Agreed that it's odd that local logins would lag, but it's trivial to check if your DNS is working and/or if your clients have reverse DNS configured. Try that? –  Joel K Feb 3 '11 at 22:34

Take a look at the UseDNS [yes|no] in the sshd_config file. If it is set to Yes there is a good chance that a delay will/can occur. Take a look here: OpenSSH FAQ especially chapter 3.3. It also points to some other possible delay causes.

share|improve this answer

Perhaps your /bin/login has been replaced by an evil twin that ships your passwords offsite. If such a program is poorly written, it could be hanging and/or timing out.

Perhaps your user's (or system-wide) shell profile/rc is running something slow

Are logins also slow in single user (runlevel 1) mode? Are you in runlevel 5? if so, try going to runlevel 3 (if you can) and see if there's a change in login speed.

share|improve this answer
    
/bin/login/: The system was connected to the network after the important partitions were made read only. I checked just in case. –  Jamie Feb 3 '11 at 23:03

Do you have nscd running (pidof nscd)? If so, shut it down and see if it gets better. If it does get better, do rm /var/db/nscd/* and start it back up.

share|improve this answer
    
No, but thanks for the suggestion. –  Jamie Feb 4 '11 at 1:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.