Server Fault is a question and answer site for system and network administrators. 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

My ssh connection to my server works every 30 min for around 10 min.

Things that I figure out that might be the problem:

  • The server is underload (it is a database server), but on those spare moments that I can connect, it is still under the same load, which doesnt make sense.

  • The server is a ubuntu, and the consolekit was using a lot of virtual memory. Restarted the consolekit and it seems to be using a right amount of memory now.

  • It is not the host alows or deny. Those are setup properly.

  • It is not a firewall problem. Those settings were working and the same settings are working for other similar machines.

  • It is on the ec2. Amazon cloud.

share|improve this question

You need to increase the logging level in /etc/ssh/sshd_config on the server and see if anything useful is in the logs under /var/logs after that. Also you should consider starting your sshd with -d for debug mode and see if you can find anything interesting that way.

Another good troubleshooting technique is to start sshd with -d and use strace -p <pid> to log the system calls made by your ssh servers. That could tell you if it's hanging on accessing a particular file for example.

share|improve this answer

That often comes from an inability to write to the /var area of your system, we see this from time to time on our system, especially if /var goes to read only. check that via cat /proc/mounts ( use this not ANY other method as they can be fooled, this will not. )

share|improve this answer
well... now that the permissions for /var has been changed and I can't ssh to my amazon instance... any hope left? – TraderJoeChicago Jul 17 '11 at 4:11

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.