How enable SSH auth by keys with Dropbear? Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
maximumwarp
Posts: 7
Joined: Sun Jul 21, 2019 7:35 pm

How enable SSH auth by keys with Dropbear?

Post by maximumwarp »

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

Code: Select all

ssh-copy-id -i ~/.ssh/mykey user@host
but with Dropbear this method doesn't work, what can I do?

Thank you!
maximumwarp
Posts: 7
Joined: Sun Jul 21, 2019 7:35 pm

Re: How enable SSH auth by keys with Dropbear?

Post by maximumwarp »

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

Code: Select all

~/.ssh/authorized_keys
with

Code: Select all

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)!
Post Reply