I do not know what is wrong with my rPi 3 running Rasbpian. Earlier today, it was working as expected. I was in the middle of an SSH session when I suddenly got disconnected without warning. Attempting to reconnect yielded no results, just a ssh: connect to host port 22: Connection refused. Resetting the Pi doesn't help.

I have tried placing a ssh file on the boot partition again, with no success. I've copied over the original ssh binary from the Raspbian disk image, as well as the original /etc/ssh, neither which seem to have done anything.

I know the Pi has started up and is running correctly. I can ping it, and the Nginx I have installed on it still works.

I do not have any kind of screen to hook up to the Pi. Remote operation is my only option.

If I mount the SD card I can see this in the boot logs:

Jan 16 17:17:21 raspberrypi systemd[1]: ssh.service holdoff time over, scheduling restart.
Jan 16 17:17:21 raspberrypi systemd[1]: Stopping OpenBSD Secure Shell server...
Jan 16 17:17:21 raspberrypi systemd[1]: Starting OpenBSD Secure Shell server...
Jan 16 17:17:21 raspberrypi systemd[1]: ssh.service start request repeated too quickly, refusing to start.
Jan 16 17:17:21 raspberrypi systemd[1]: Failed to start OpenBSD Secure Shell server.
Jan 16 17:17:21 raspberrypi systemd[1]: Unit ssh.service entered failed state.

But I'm not sure what to make of it.

  • Your SD-card maybe get corrupted
    – kev
    Jan 17, 2017 at 8:14
  • You missed the relevant error message (it would be from sshd, not from systemd). By the time systemd realizes a restart is needed, the bad stuff has already happened. Jan 17, 2017 at 14:07

1 Answer 1


So, I did manage to fix it.

The fix involves installing QEMU so as to chroot onto the SD card. Detailed instructions here.

After that, it's a question of apt-get remove --purge openssh-server apt-get install openssh-server and hoping for the best. In my case, I had to reinsall several other packages before that worked.

It's quite clear at this point that my SD card is hopelessly corrupted, and the reasonable thing to do now is migrate to a new one before the whole thing collapses in on itself, which I'll do, but for now: It works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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