In this example, we will setup a SSH server on Termux (for Android) and connect to the server from Ubuntu desktop. However, a similar procedure should work with any SSH server.
-
Generate your ssh key pair on your desktop
$ ssh-keygen
-
Check your desktop IP address (say, 192.168.0.100)
-
Run ssh server on your desktop
-
Copy the file to Termux over SCP
$ scp arun@192.168.0.100:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
You can stop ssh server on your desktop now
-
Install ssh server on Termux
$ pkg in openssh
-
Run ssh server on Termux (IP address 192.168.0.102)
$ sshd
-
Find out your username on Termux
$ whoami u0_z007
-
Connect from your desktop
$ ssh u0_z007@192.168.0.102 -p 8022 Welcome to Termux!
I used it on window 10 with git bash and it worked thank you brother.