Installed ssh and now can't login as root

While testing some home automation stuff, I installed ssh to do some troubleshooting for an issue I was having. I solved the issue, but once I restarted, my root login no longer works with putty. I put in my username and password as normal, but I get an “Access Denied” error.

I can login as “dietpi” but not as root. I can even login as dietpi, and SU to root…but I can’t login as root directly.

The first time I connected, putty alerted that there was an encryption key mismatch from the previously stored key (most likely because my ssh server replaced dropbear).

How can I uninstall ssh cleanly so that I can go back to dropbear without risking losing ssh entirely?

Hi,

usually switching between Dropbear and OpenSSH should be done using dietpi-software. There is a special option to choose SSH server preference. This will ensure a safe transition between both. I would not recommend to install an SSH server outside dietpi-software.

Yes, not installing an ssh external to dietpi is a lesson that I have now learned well.

Dietpi-software was still reflecting dropbear as the default ssh server. I swapped to openssh. It installed, but “reboot” was not found. I did a systemctl reboot. My guess is that a lot of dietpi scripts rely on “reboot”.

if you have direct access to your system, remove all SSH server and perform a new installation via dietpi-software > SSH Server preference.

Did you removed Dropbear before installation of your SSH server?

I did not remove dropbear. I do have direct access. I changed to openssh, but got the error at the end of it that “reboot” was not found.

I performed systemctl reboot, but my guess is that a LOT of dietpi’s scripts will need “reboot” to function properly.

It’s fixed… dropbear is the default again, i can login as root, and reboot is working again.

Scary.

Thanks for the help tho! You guys are awesome.

a reboot is performed on software installations only. You would have 2 conflicting SSH server if you installed OpenSSH without removing Dropbear before.