Setting up a non-root user with SSH access

I keep having to look this up every time I set up a new machine. So here are the steps for future me: 1 # Create a user and add to the sudo group 2 adduser galdin 3 usermod -aG sudo galdin 4 5 # Setup SSH 6 su - galdin 7 mkdir -p ~/.ssh 8 chmod 700 ~/.ssh 9 10 # Exit the ssh session 11 # and copy the local SSH key over 12 exit 13 exit 14 ssh-copy-id galdin@ 15 16 # Log in again! 17 ssh galdin@