sudo adduser username
Grant privilages.
sudo usermod -aG sudo username
Use the su command to switch to the new user account.
su - username
Use this command to remove entries from known_hosts:
ssh-keygen -R hostname
# works with ips as well
Create file authorized_keys and copy data to it from the root file. It can be done via
rsync --archive --chown=sammy:sammy ~/.ssh /home/sammy
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/automating-initial-server-setup-with-ubuntu-18-04