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.

link|improve this question

60% accept rate
feedback

2 Answers

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.

link|improve this answer
feedback

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. )

link|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? – Sergio Oliveira Jr. Jul 17 '11 at 4:11
feedback

Your Answer

 
or
required, but never shown

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