1. Install Termux in android using F-droid
  2. Upgrade softwares.
$ pkg update
$ pkg upgrade
  1. install openssh
$ pkg install openssh
  1. setup a password
$ passwd
  1. Start an ssh server
$ sshd  // start an ssh server
$ ifconfig // know your phone inet ip
  1. In your pc/laptop.
$ ssh <ipaddress of your phone> -p 8022
  1. Congrats. you have ssh’d into your phone.
  2. When done with it
$ pkill sshd

Troubleshooting

  • Waiting too long - try to ping that ip, Recheck the ip address, reboot your phone.