Created
July 15, 2016 18:33
-
-
Save tphummel/c4763d4a7b4b73a4428526ede98aae6f to your computer and use it in GitHub Desktop.
add github user keys to authorized_keys via cloud-init/userdata
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
#!/usr/bin/env bash | |
set -o nounset | |
set -o errexit | |
set -o pipefail | |
IFS=$'\n\t' | |
main(){ | |
users=( "tphummel" "githubuser2" "githubuser3" ) | |
ssh_user="ssh_user" | |
for i in "${users[@]}" | |
do | |
curl "https://github.com/${i}.keys" >> "/home/${ssh_user}/.ssh/authorized_keys" | |
done | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment