Good day, I'm trying to figure out how to get a user to ssh into openWRT with only a key. I followed these instructions: https://wiki.openwrt.org/oldwiki/dropbearpublickeyauthenticationhowto.
In short: On a Linux box: If you haven't already got a
.ssh/id_dsa.pub
ssh-keygen -t dsa
scp ~/.ssh/id_dsa.pub [email protected]:/tmp
On openWRT:
cd /etc/dropbear
cat /tmp/id_*.pub >> authorized_keys
chmod 0600 authorized_keys
When I try and ssh in, I get this error:
authpriv.warn dropbear[2085]: Pubkey auth attempt with unknown algo for 'MyUser' from 1.2.3.4:11111
I have tried generating a RSA key too, same result. I can log in as the user using a password:
authpriv.notice dropbear[2089]: Password auth succeeded for 'MyUser' from 1.2.3.4:11111
Maybe it's the problem of the OpenWRT version.
Try ${HOME}/.ssh/authorized_keys
instead.
Using libreCMC v1.5.15 (and earlier versions), which is based on OpenWRT, I noticed the following dropbear error in the system log:
Sat Jun 8 21:21:26 2024 authpriv.info dropbear[22699]: /etc/dropbear/authorized_keys must be owned by user or root, and not writable by others
So I temporarily enabled password authentication for the SSH service (dropbear), and ran:
chown root:root /etc/dropbear/authorized_keys
This appears to have resolved the problem for me; publickey authentication now succeeds and I've removed password authentication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With