opkg install python3 python3-pip iptables-mod-nat-extra iptables-mod-ipopt
python3 /usr/bin/pip3 install sshuttle
sshuttle -l 0.0.0.0 -r <IP> -x 192.168.1.1 0/0
Problem:
Hi.
Everytime I want to reboot router I have to run command and enter password manually
sshuttle -e "ssh -i /root/.ssh/id_rsa" -l 0.0.0.0 -r root@192.168.1.1 0/0 --dns
and it is still asking for password even after generating rsa key
dropbearkey -t rsa -f /root/.ssh/id_rsa
Output:
root@OpenWrt:~# sshuttle -e "ssh -i /root/.ssh/id_rsa" -l 0.0.0.0 -r root@192.168.1.1 0/0 --dns
WARNING: Ignoring unknown option --
root@192.168.1.1's password:On Debian I use sshpass with password generated with gpg and that's how I run it.
nohup gpg -d -q .sshpassword.gpg > fifo; sshpass -f fifo sshuttle -l 0.0.0.0 --dns -r root@109.235.69.18 0/0 >/dev/null 2>&1 &
I need help because I need to connect to my local or remote server in some automated way.
Solution for my problem
OpenWrt 19.07.2, r10947-65030d81f3
Create the key (private and public) =
dropbearkey -t rsa -f /root/.ssh/id_rsa
then:
dropbearkey -y -f ~/.ssh/id_rsa | grep "^ssh-rsa " > ~/.ssh/id_rsa.pub
vi /etc/dropbear/authorized_keys
add keys here#Login to openwrt router and execute the following
cat ~/.ssh/id_rsa.pub | ssh myremoteaccount@serverssh "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys"