4

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 root@192.168.1.1:/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

Vissie
  • 174
  • 1
  • 11

1 Answers1

2

Maybe it's the problem of the OpenWRT version. Try ${HOME}/.ssh/authorized_keys instead.

Beryllium
  • 12,808
  • 10
  • 56
  • 86
Yangtuo250
  • 36
  • 2
  • Yes, spot on! Thx! – Vissie Nov 30 '17 at 09:01
  • That solved it for me also, using a 2019 Buildroot image. I also had to add `PubkeyAcceptedKeyTypes +ssh-rsa` to my Host definition on my client side, because recent openssh refuses to use RSA signed keys (use `ssh -vvv` and look for the "no mutual signature algorithm" debug message). – Apteryx Dec 14 '22 at 16:15