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
 2adduser galdin
 3usermod -aG sudo galdin
 4
 5# Setup SSH
 6su - galdin
 7mkdir  -p ~/.ssh
 8chmod 700 ~/.ssh
 9
10# Exit the ssh session 
11# and copy the local SSH key over
12exit
13exit
14ssh-copy-id galdin@
15
16# Log in again!
17ssh galdin@

<< Previous Post

|

Next Post >>

#Linux #SSH #Random