Running sshuttle on (rooted) Android uses wrong .ssh folder ?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 795
- Avg merge
- 8h 49m
- Merged PRs (30d)
- 12
Description
When I use sshuttle to try as an Android VPN I tried first running in a Termux terminal (Termux being a Debian based interface on Android):
sshuttle -r admin@server 0.0.0.0/0
I installed sshuttle by pip install sshuttle. Termux has a package manager like Debian and I installed Python 3.9 including pip on it as I use more tools using Python in Termux.
The sshuttle command lets Magisk prompt for allowing root access for Termux which I consented. But the command failed. Then I first started a root shell with sudo bash and the I ran the same command.
Here is what I attempted (connected with SSH into Termux on my Android phone):
~ $ sshuttle -r user@server 0.0.0.0/0 -x 192.168.0.0/16
/usr/bin/env: ‘doas’: No such file or directory
fw: fatal: You must be root (or enable su/sudo) to set the firewall
c : fatal: All attempts to elevate privileges failed.
~ $ sudo sshuttle -r user@server 0.0.0.0/0 -x 192.168.0.0/16
Bad owner or permissions on /data/data/com.termux/files/home/.ssh/config
c : fatal: failed to establish ssh session (2)
~ $ su
:/data/data/com.termux/files/home # echo $PATH
/sbin:/sbin/su:/su/bin:/su/xbin:/system/bin:/system/xbin
:/data/data/com.termux/files/home #
:/data/data/com.termux/files/home # sshuttle -r user@server 0.0.0.0/0 -x 192.168.0.0/16
/system/bin/sh: sshuttle: inaccessible or not found
127|:/data/data/com.termux/files/home # ^D
~ $
logout
When I started su it opens a separate shell using the Android root shell which cannot find sshuttle at all because the PATH (and other environmental) settings are different.
Weird, as when I run echo $HOME which returns the correct path /data/data/com.termux/files/home/.suroot which is the home folder for elevated commands under Termux. That folder and it subfolders are correctly owned by root and not Termux user(u0_axxx). But the error shows the 'standard' home path of Termux in normal (non-root) mode. I'd expect that it uses the folder /data/data/com.termux/files/home/.suroot/.ssh.
How does sshuttle handle with the .ssh folder ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported commands in Termux, comparing normal execution, sudo, and su, and inspect the differing HOME and PATH values plus the reported .ssh/config path. Done means establishing which home and SSH configuration sshuttle uses for elevated commands and documenting or correcting the behavior for this Android setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, python
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100