Whenever I ssh to elsewhere, the connection is fine for 1-10 minutes, then hangs: no error messages, just stops accepting input. I can exit (CR-~-.) but that's it. I can't find anything suspicious in my logs, or on the server I'm connecting to. Running ssh -vvv doesn't produce any messages around the time of disconnection, and connecting to sshd -dd doesn't say anything then either. I don't think it's a timeout, since it happens at irregular intervals: sometimes 1 minute, sometimes 10. I can tell exactly when it disconnects by running while $(sleep 1); do date; done on the remote computer.

Other notes:

  • All ssh connections I have running at once hang at the same time.
  • tcpdump shows me that when it hangs, it also stops sending or receiving packets.
  • netstat says that the connection is still ESTABLISHED, however.
  • It sounds a lot like this thread, but setting ServerAliveInterval to e.g. 30 instead results in the connection ending with Timeout, server not responding.
  • I'm running openssh 1:6.7p1-2 in Debian sid.

This may well be a problem with connectivity, not just ssh, but I'm trying to get debugging information, somehow.

How can I debug this?

  • this sound like a firewall/router is blocking you.
    – Archemar
    Oct 17, 2014 at 7:03
  • is there any way to tell?
    – petrelharp
    Oct 17, 2014 at 15:46
  • Can you run tcpdump on the server ? This might give a clue about what's happening. I'd run it inside a screen session and detach it so it doesn't interfere / isn't affected by disconnects. Oct 18, 2014 at 8:23
  • We had a similar problem which turned out to be caused by routing problems on a device with multiple VLANs and a physical connection.
    – zpon
    Feb 13, 2018 at 12:49


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.