Mam dwa routery z zainstalowanym openwrt. Chciałem móc wykonywać jedno polecenie wydane z jednego routa na drugim bez podawania hasła.
1. Na źródłowym serwerze stworzyłem klucze i następnie przekonwertowałem aby dropbear mógł go używać:
ssh-keygen -t rsa dropbearconvert openssh dropbear id_rsa /etc/dropbear/server1_identity
2. Na serwerze docelowym klucz publiczny dodaje do pliku authorized_keys:
root@Gargoyle:/etc/dropbear# ls -l /etc/dropbear/authorized_keys -rw------- 1 root root 394 Mar 27 20:30 /etc/dropbear/authorized_keys
I teraz mogę się logować bez podawania hasła!
root@router:~/.ssh# ssh -i /etc/private_rsa_key root@192.168.200.30
BusyBox v1.19.4 (2014-01-22 14:20:14 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_____ _
| __ \ | |
| | \/ __ _ _ __ __ _ ___ _ _| | ___
| | __ / _` | '__/ _` |/ _ \| | | | |/ _ \
| |_\ \ (_| | | | (_| | (_) | |_| | | __/
\____/\__,_|_| \__, |\___/ \__, |_|\___|
__/ | __/ |
|___/ |___/