My android 4.4.2 (it is old but can't be upgraded) phone runs a SSH server by SimpleSSHD app. It generates different random password at every login, so is very inconvenient for me as a client user. So I would like to use public key authentication.
Previously I have generated a pair of public and private keys to access a SSH server. I guess it is okay to reuse the key pair, so I copy the public key file to the android phone:
$ ssh-copy-id -p 2222 192.168.1.87 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/t/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys firstname.lastname@example.org's password: restorecon: invalid option -- F usage: restorecon [-nrRv] pathname...
After that I still have to type random passwords generated by the server in order to log in.
Does copying the public key file to the android phone not work?
Into which directory on the android phone should the public key file go?