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
Check your desktop IP address (say, 192.168.0.100)
Run ssh server on your desktop
Copy the file to Termux over SCP
$ scp firstname.lastname@example.org:~/.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)
Find out your username on Termux
$ whoami u0_z007
Connect from your desktop
$ ssh email@example.com -p 8022 Welcome to Termux!