How to set up SSH authentication without a password

From Computing, Technology, HowTo Wiki

Jump to: navigation, search

Contents

On the local host (Linux), type:

ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Pess enter key]
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 user@local-host

Copy the public key to the remote host, type:

ssh-copy-id -i ~/.ssh/id_rsa.pub remotehost

Now try and log in to remote host

ssh remotehost