This is just a personal reference.
Generate the key for the user. This should be done on the local machine:
ssh-keygen -t rsa -b 4096 -o -a 100
Create a new user on the remote machine. The
-m adds a deuser fault user home directory.
useradd -m new-user
Switch to the new user:
sudo su new-user
.ssh directory for the user:
Set the right permissions:
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
Add the public key you created to the