Last active
August 29, 2015 14:18
-
-
Save jimmidyson/30d5af1afa49296eed35 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
for user in "$@" | |
do | |
echo "Adding ${user}" | |
useradd -m ${user} | |
mkdir /home/${user}/.ssh | |
curl https://github.com/${user}.keys >> /home/${user}/.ssh/authorized_keys | |
chmod 700 /home/${user}/.ssh | |
chmod 600 /home/${user}/.ssh/authorized_keys | |
chown -R ${user}:${user} /home/${user}/.ssh | |
usermod -a -G wheel ${user} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment