Setting up SSH public key authentication on Raspberry Pi
I followed this guide to setup SSH public key authentication.
First copy your public SSH key to the destination host
# The destination user
export USER=pi
# The destination host
export HOST=192.168.0.13
ssh-copy-id $USER:$HOST
Then test if you can now connect to the destination host without needing to enter a password
ssh $USER@$HOST
If this works, you can safely edit the destination hosts’ SSH configuration file to disable password authentication as a whole
sudo vi /etc/ssh_sshd_config
Search for the line containing PasswordAuthentication
and change this line to
PasswordAuthentication no