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.

we have a Centos server and currently SSH access to it isn't working. It used to work until some 5 days ago. Now, the only way to log into the machine is to do it locally. We have tried SSH both using Putty and FileZilla with no success. The machine is alive and answering. I can ping it and the Apache service is up and running. But SSH access isn't available. When I try it using Putty, the machine answers asking me to type the username. I do it. When it asks me for the password, it never answers again and, after some 60 seconds, it times out... Any ideas where we should work to try to sove this problem? Thank you in advance!

share|improve this question
    
I'd follow the troubleshooting guide on the following link: docstore.mik.ua/orelly/networking_2ndEd/ssh/ch12_01.htm –  gyre May 8 '12 at 15:36
    
Besides the questions asked by @johnshen64: check log files /var/log/messages and /var/log/secure. What kind of authentication do you use? local accounts, LDAP, etc.? –  Bram May 8 '12 at 15:38
add comment

3 Answers

I have seen cases where SSH logins could hang due to mis-configured DNS servers in /etc/resolv.conf. Especially if sshd is using DNS for reverse lookups or logging. Check your DNS configuration on the server and verify you can ping and resolve external names like google.com.

share|improve this answer
    
The access to this server specifically has always been done through its IP address. So I think the issue probably doesn't have to do with DNS. –  Marcos Buarque May 8 '12 at 15:39
    
This seems like the symptoms of what you described. We had similar issues (although it was only about 30 seconds and it would eventually connect). Try changing UseDNS to No in the /etc/ssh/sshd_config file to completely bypass this step. And as the other two mentioned, the best way to troubleshoot is look in the logs (get into the server via the console and do ls -ltr /var/log right after the attempt. This will sort the logs by most recently modified. Look at which logs were touched and see if they have any pertinent information. Good luck. –  Safado May 8 '12 at 15:40
    
@Marcos - The SSHD will do a reverse lookup on the IP address. –  Safado May 8 '12 at 15:41
    
Hey, friends, thank you all. We will try all the items suggested in the posts from you all when the server administrator actually "sits" on the machine to try the fixes suggested. Thank you again and again. –  Marcos Buarque May 8 '12 at 16:13
add comment

It never answers?

Is it running at all? Check:

ps aux| grep sshd

Or does it accept a connection but the login doesn't go through?

Did you try typing in the password and pressing the Enter key? SSH clients usually dont write-out stars or dots like webbrowsers do.

Can you also try SSH debug mode? Try connecting from another linux box with:

ssh -vvv user@your.cent.os.ip

and check the output for any problems.

Also try sshing from the box itself ("ssh localhost"), and see if that works. You might have a network (or firewall) problem if this works, and remote ssh doesnt.

share|improve this answer
add comment

First of all you should check the logs on that server: /var/log/auth.log or similar (I don't know where sshd logs on CentOS). If the server refused the connection, the log should tell you why.

share|improve this answer
add comment

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.