- Install Termux in android using F-droid
- Upgrade softwares.
$ pkg update
$ pkg upgrade
- install openssh
$ pkg install openssh
- setup a password
$ passwd
- Start an ssh server
$ sshd // start an ssh server
$ ifconfig // know your phone inet ip
- In your pc/laptop.
$ ssh <ipaddress of your phone> -p 8022
- Congrats. you have ssh’d into your phone.
- When done with it
$ pkill sshd
Troubleshooting
- Waiting too long - try to ping that ip, Recheck the ip address, reboot your phone.