2

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

Alice
  • 41
  • 5

1 Answers1

2

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!

Alice
  • 41
  • 5