# Create user and add to sudo groupadduser louisa # With empty password to prevent password loginusermod -aG sudo louisa# Add ssh dir and auth keysu louisamkdir -p ~/.sshchmod 700 ~/.sshnano ~/.ssh/authorized_keys # Add the public key in authorized_keyschmod 600 ~/.ssh/authorized_keys# Disallow password auth and root login (Test above before)sudo nano /etc/ssh/sshd_config# set lines PasswordAuthentication & PermitRootLogin to nosudo systemctl restart ssh
Client
# Add ssh keysnano ~/.ssh/id_ed25519 # Your private key (keep this secret!)nano ~/.ssh/id_ed25519.pub # Your public key (safe to share, this is what goes on the server)chmod 700 ~/.sshchmod 600 ~/.ssh/id_rsachmod 644 ~/.ssh/id_rsa.pub