How enable SSH auth by keys with Dropbear?

Hello,
this is my first message on this forum, I knew the wonderful world of DietPi just few days ago.
I have many Raspberry Pi from the storic first model (I don’t use anymore) to the latest powerful Raspberry Pi 4 with 4GB of RAM.
For now, I installed DietPi on a model 2B and on model 4, I’m using the default Dropbear SSH server but I need to configure it for no-password login. With Raspbian SSH default server I just need to copy may keys from my clients to server with

ssh-copy-id -i ~/.ssh/mykey user@host

but with Dropbear this method doesn’t work, what can I do?

Thank you!

I solved the problem: Dropbear doesn’t support ed25519 so it’s necessary to generate rsa or ecdsa (I used this system) keys, then you can copy public key to Raspberry Pi in the authorized_keys file in .ssh home subdir

~/.ssh/authorized_keys

with

ssh root@raspberry_ip "tee -a ~/.ssh/authorized_keys" < ~/.ssh/your_key.pub

.

The authorized_keys file must be readable and writeable by the owners only (permission 600)!

1 Like