Skip to content

Instantly share code, notes, and snippets.

@srs81
Created July 30, 2012 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srs81/3207564 to your computer and use it in GitHub Desktop.
Save srs81/3207564 to your computer and use it in GitHub Desktop.
Create a new user and give them access through SSH public/private keys
# Change to sudo
sudo su
# Export the username you want to create
export USERNAME=name
adduser $USERNAME
cd /home/$USERNAME
# Create the SSH keys
mkdir .ssh
vi .ssh/authorized_keys
# Copy-paste SSH public key into vi window
# Change permissions
chown -R $USERNAME:$USERNAME .ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment