Reference: Linode Documentation on Public Key Authentication with SSH
(1) If the file
~/.ssh/id_rsa.pub doesn’t exist, generate it with the command below:
ssh-keygen -b 4096
(2) Upload the public key into the remote server you want to SSH into:
your_username with the admin user of the target server.
192.0.2.0 with the IP address of the target server.
This will append the public key to the
~/.ssh/authorized_keys file in the target server.
Now you can SSH into the target server without having to log in manually.
Another way is to manually copy over the
id_rsa.pub file to the target server and create the
~/.ssh/authorized_keys file with the contents of