Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

So we recently have done some IT restructuring for one our server networks. I am able to generally ssh to the machine, but usually within a small time frame (< 1 min) the SSH connection is dropped with the following error message:

Write failed: Connection reset by peer

Sometimes my SSH command is just outright refused as well:

ssh: connect to host port 22: Connection refused

This is making server adminstration tricky to say the least. Unfortunately I am not very well versed in IT and so I am unsure how to try and figure out what is causing the issue. I have looked at the SSH connection settings on the machine and they appear to be normal.

How can I go about tracing the problem?

Verbose Output:

Failed Connection:

ssh -v
OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Connecting to [ip.ip.ip.ip] port 22.
debug1: connect to address ip.ip.ip.ip port 22: Connection timed out
ssh: connect to host port 22: Connection timed out

Dropped Connection:

There is a ton of info printed out when first connecting, but when the connection is dropped all that is printed is:

Write failed: Connection reset by peer
share|improve this question
This doesn't sound like a SSH-specific problem (try pinging the server immediately when the connection fails, just to check). You might want to try this:… – Aug 15 '13 at 14:59
Once connected, do SSH sessions drop only when left idle, or always? In the former case, you might consider setting ServerAliveInterval in ~/.ssh/config (see man ssh_config for more). – Aaron Miller Aug 15 '13 at 16:33
In general SSH is TCP and hence never dropped, even when idle. But are you maybe passing through any kind of firewall, e.g. with NAT? You may want to try setting keepalive in the ssh configuration. Though this has nothing to do with the connection refused issue ... Is the server under heavy load (networkwise)? – Hagen von Eitzen Aug 15 '13 at 18:08
@AaronMiller Always, even while in use. – thatidiotguy Aug 15 '13 at 19:24
@HagenvonEitzen It is not under heavy load no. It is a server I use for development, and after some network changes is behaving very poorly. I am starting to think that it may be a routing issue. – thatidiotguy Aug 15 '13 at 19:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.