ssh-copy-id -i ~/.ssh/my_key_rsa user@server_address
Uncomment the following line from the sshd config file located at /etc/ssh/sshd_config
AuthorizedKeysFile %h/.ssh/authorized_keys
Then restart the ssh deamon
$ sudo systemctl restart sshd
Create the authorized_keys
file in the .ssh
folder of the home folder of the user you want to connect with.
$ touch ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
Add the content of your id_rsa.pub
file in the authorized_keys
file on the server.