Cannot configure ssh key

Hi, trying to setup ssh login, so that i can hop into my machine from my android, which makes me feel cool, hehe.
so i am using openssh.

  1. i configured my port by uncommenting port 22 in /etc/ssh/sshd_config
  2. then i started the daemon by sudo systemctl start sshd.service
  3. i tried to generate a key ssh-keygen and got a file mikadokey.pub
  4. then i tried to add the key to my sshd server with ssh-copy-id -i ~/mikadokey.pub -p <port> user@ip
  5. then i copied the file to my android, boot up termux. and then i did ssh -i mikadokey.pub -p <port> user@ip

it says something like this:

the authenticity of host can't be established. fingerprint is .... 
The key is not known by any other names. 
are you sure.... 
warning permanently added... 
Load key "mikadokey.pub" : error in libcrypto
user@ip's password:

Is the android the client in this case? The client needs the private key. It looks like you are trying to use the public key on both sides.

1 Like

how do i generate a private key? what does the ssh-keygen do?

It generates both. The private key is named keyname and the public is named is named keyname.pub. By default, both will be placed in ~/.ssh

1 Like

aha, i missed that part.

thank you <3

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.