- Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it, can be done quickly using
adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
-
Then run the app inside the android device, locate and tap on it
-
Run the following commands inside the app, use the on device keyboard, (choose default option when asked question, just hit enter)
pkg install root-repo
pkg upgrade
pkg install openssh
-
Set a password for the current user by
passwd, remember this password you will need it later -
Start SSH server inside android by running
sshd, do not close/exit the app after running the command -
On the pc terminal run the following, dont use
root@as prefix to the ip address
ssh <ip address of android device> -p 8022
-
This will drop you into a shell where you can do further installs using
pkg install <name> -
If for some odd reason you are getting Host key verification failed error, run the following first
ssh-keygen -R <ip address of android device>
If it still gives you trouble edit ~/.ssh/known_hosts, locate the line(s) with the ip address and delete it and
then connect again
Extracted from Termux's wiki on this topic from here [https://wiki.termux.com/wiki/Remote_Access]