Last active
August 29, 2015 14:16
-
-
Save vadimii/a4c4189147a809220300 to your computer and use it in GitHub Desktop.
GitHub user to linux
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
username=$1 # github username | |
useradd $username | |
usermod -aG wheel $username | |
sudo -u $username /usr/local/bin/ghkeys.sh |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
mkdir -p $HOME/.ssh | |
chmod 700 $HOME/.ssh | |
curl -s https://api.github.com/users/$USER/keys | \ | |
jq -r '.[].key' > $HOME/.ssh/authorized_keys | |
chmod 600 $HOME/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment