This tutorial explains how to set up SSH public key authentication on a CentOS/RHEL desktop. There’re basically two ways of authenticating user login with OpenSSH server: password authentication and public key authentication. The latter is also known as passwordless SSH login because you don’t need to enter your password.
Step 1: Generate SSH Public/Private Key Pair on CentOS/RHEL Desktop
On your CentOS/RHEL desktop (not your server), enter the following command in a terminal window.
ssh-keygen -t rsa -b 4096
Where:
-t
stands fortype
. The above command generates an RSA type keypair. RSA is the default type.-b
stands forbits
. By default, the key is 3072 bits long. We use a 4096 bits key for stronger security.
Read full tutorial here: https://www.linuxbabe.com/redhat/generate-centos-ssh-public-key