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!
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.
-
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. May 8, 2012 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 dols -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.– SafadoMay 8, 2012 at 15:40 -
-
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. May 8, 2012 at 16:13
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 [email protected]
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.
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.
/var/log/messages
and/var/log/secure
. What kind of authentication do you use? local accounts, LDAP, etc.?