There are 2 parts to getting password-less, key-based ssh login to work. The first is to generate ssh keys for the user you are going to be accessing the remote host from i.e. your local machine. You then copy the public key of this local user to the remote user you want to login to the remote machine as. These are the steps to take:
1. Generate a public key pair on the local machine:
1. Generate a public key pair on the local machine:
$ ssh-keygen -t ed25519
This will generate a couple of files in ~/.ssh. You can/should skip this step if this has already been done.
2. Use the ssh-copy-id script to copy the local public key to the remote user:
2. Use the ssh-copy-id script to copy the local public key to the remote user:
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host
Make sure you just copy the .pub file. An option to use a different SSH port is -p port_number. This is ONLY necessary if you are not using the standard port, 22.
3. Then try logging into the remote machine - you shouldn't be asked for a password!
BTW, you have several types of public key algorithms for authentication keys: rsa, dsa, ecdsa, ed25519
3. Then try logging into the remote machine - you shouldn't be asked for a password!
BTW, you have several types of public key algorithms for authentication keys: rsa, dsa, ecdsa, ed25519
See here for more info: https://www.ssh.com/ssh/keygen/#choosing-an-algorithm-and-key-size