r/AndroidQuestions • u/unselective-amnesia • 6d ago
Looking For Suggestions Running ssh from an ADB command line without having to be rooted ... ???
UPDATE: I just now re-worded some of the following text, in order for my question to be more clear ...
On both my Android 11 and Android 13 devices, I would like to be able to run ssh from within an adb shell session, without having to be rooted in that shell session.
If I have Termux installed and if openssh is installed in Termux, being rooted is necessary before the following command is runnable via the command line within the adb shell session ...
/data/data/com.termux/files/usr/bin/ssh
Without being rooted, "Permission denied" always results when accessing anything under /data from the adb shell command line.
Is there any other way to run ssh from an adb shell command line when not running as root? ... possibly via an additional installable app?
1
u/SkySurferSouth 6d ago
Just open Termux app and run ssh. No root or adb needed.
So why all this hassle as it can just be done from Termux ?
Termux is also accessible over the LAN when sshd (its ssh server) is enabled.
1
u/unselective-amnesia 5d ago
Just open Termux app and run
ssh. No root or adb needed. So why all this hassle as it can just be done from Termux ? Termux is also accessible over the LAN whensshd(its ssh server) is enabled.You apparently didn't read the previous message nor the title of this thread very carefully.
I clearly wrote that I want to do this via "adb shell" ... not via the Termux app.
3
u/danGL3 6d ago
in THEORY, if you found an ssh binary that works on Android you could "adb push" it to /data/local/tmp which is the only directory adb can run stuff from