Created
July 30, 2012 14:54
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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