Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CentOS Linux server with a SSH connection. It works perfectly but from time to time, the server refuses the connection.

If I reboot the server, I can SSH again.

What could be wrong?

share|improve this question
What do you have in the logs? – Mat Nov 25 '12 at 10:29
what log should I check? – SpaceDog Nov 25 '12 at 10:35
/var/log/messages and the other stuff in there. – Mat Nov 25 '12 at 10:54
up vote 4 down vote accepted

Try running sshd on the server in debug mode (-d, you can go up to -ddd) to get additional info. You can do this even remotely if don't happen to have the server under your table: log in, and then you can start another sshd instance on a different port with the -p option and try to log on into this instance.

share|improve this answer

Check to log on the server:

grep -Ri ssh /var/log/*

and also use SSH with more verbosity on the client:

ssh -vvv user@server
share|improve this answer

Your Answer


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.