Install & Configure SSHUTTLE ! Tutorial

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 :slight_smile:

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"

Hi! After the first step of opkg install XXXX everything is fine, but when installing sshuttle with pip I constantly run into an out of memory problem. I tried to comment out some of the lines in the distfeeds.conf file as suggested in other topics about OOM Errors but it didnt change anything. Also I tried to look up and delete any files I didnt need, which were close to none. So my device might be too small for the task? Is there an option? I think having an own sshuttle opkg package might work as I guess most of the memory needed for the installation will be used by the pip command which is itself dependent on python3. So that needs space and I read about distinguished packages of opkg might solute this problem in an discussion about flask. Is there any way I can install and use sshuttle despite my OOM Error or might there be a workaround? I hope you might help me. Big thanks!