Update on April 15, 2023
SSH keys are a more secure way of logging into a server than pass words.
To generate SSH keys:
ssh-keygen
The command will generate both a private key, id_rsa,
and a public key, id_rsa_pub. It will prompt you for
where to store the keys.
The default location is:
~/.ssh
It will also prompt you for a paraphrase to be used as a password. For no password, leave blank.
To transfer the public key to a server:
ssh-copy-id pi@192.168.0.x
It will prompt you for your password for the last time. In the future, it will use your public key for authentication.
It stores the public key on the server in the file:
~/.ssh/authorized_keys
Once SSH keys are setup and working, you can make your password a lot longer, or you can disable SSH password authentication.
To disable SSH password authentication for
a particular user, add the following to:
/etc/ssh/sshd_config
Match User user_name
PasswordAuthentication no
Without the "Match" line, this will deny all users from logging in via a password.