^This. Also worth mentioning for completeness that in addition to the owner (root:root in this case) and protection (600) being correct, the authorized_keys file must contain the public key for the private key you're using on the client system.Keys are not user specific, but the public key needs to be installed in the users home on the Raspberry Pi, i.e. /root/.ssh/authorized_keys.That is likely because you created your ssh key using you username and not root - keys are generally user specificI checked in my newly installed rpi3b
SSH with root … permission denied always
SSH with my username … works all the time
You can do this: “sudo su - “ after your login
/root/.ssh and /root/.ssh/authorized_keys must be owned by root.
Login as default userWorked out of the box on my Raspberry Pi OS Bookworm LiteCode:
sudo cp -aR .ssh /rootsudo chown root:root /root/.sshsudo chown root:root /root/.ssh/authorized_keys
Statistics: Posted by bls — Mon Jul 14, 2025 5:10 pm