Install & Configure SSHUTTLE ! Tutorial

opkg install python3 python3-pip iptables-mod-nat-extra iptables-mod-ipopt
python3 /usr/bin/pip3 install sshuttle
sshuttle -l -r <IP> -x 0/0


Everytime I want to reboot router I have to run command and enter password manually
sshuttle -e "ssh -i /root/.ssh/id_rsa" -l -r root@ 0/0 --dns

and it is still asking for password even after generating rsa key
dropbearkey -t rsa -f /root/.ssh/id_rsa


root@OpenWrt:~# sshuttle -e "ssh -i /root/.ssh/id_rsa" -l -r root@ 0/0 --dns
WARNING: Ignoring unknown option --
root@'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 --dns -r root@ 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
dropbearkey -y -f ~/.ssh/id_rsa | grep "^ssh-rsa " > ~/.ssh/

vi /etc/dropbear/authorized_keys
add keys here

#Login to openwrt router and execute the following
cat ~/.ssh/ | 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!