SSH Keys

SSH keys are a method of identifying trusted computers without passwords.

 

Create RSA Key Pair:

ssh-keygen -t rsa

Store the Key:

Enter file in which to save the key (/home/user/.ssh/id_rsa):

Secure Key with Passphrase:

Enter passphrase (empty for no passphrase):

Copy the Public Key to Remote Server:

ssh-copy-id user@your.domain.name

 

 

— Optional — Disable the Password for Root Login:

Open up the SSH config file:

sudo nano /etc/ssh/sshd_config

Within that file, find the line that includes PermitRootLogin and modify it to ensure that users can only connect with their SSH key:

PermitRootLogin without-password

Put the changes into effect:

reload ssh