...
Create the user account.
Code Block sudo adduser username
Do not enter a password when prompted, as the SSH key will be the method of authentication.
If necessary, add the user to the sudo group.
Code Block sudo usermod -aG sudo username
User .ssh folder
Setup the user SSH folder.
...
From a terminal, generate the SSH key pair.
Code Block ssh-keygen -t rsa
Confirm the output filename of the key files. This can be changed to modify the location where the key files will be created and the name of the files.
Optionally, enter a passphrase if one is desired. Confirm passphrase, if one is used.
This will generate two files, a private key file (e.g.,
~/.ssh/id_rsa
) and a public key file (e.g.,~/.ssh/id_rsa.pub
).