Skip to content

Instantly share code, notes, and snippets.

@MaxHalford
Last active July 26, 2017 15:23
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 MaxHalford/cbdf1ebf9d6e5f26a766e37bf7dc791d to your computer and use it in GitHub Desktop.
Save MaxHalford/cbdf1ebf9d6e5f26a766e37bf7dc791d to your computer and use it in GitHub Desktop.
Add user to a server
sudo -i
groupadd mhalford
useradd -g mhalford -G sudo -s /bin/bash -m -d /home/mhalford mhalford
cd /home/mhalford
mkdir .ssh
echo COPY_PASTE_PUBLIC_KEY_HERE >> .ssh/authorized_keys
cd ..
chown -R mhalford:mhalford mhalford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment