Skip to content

Instantly share code, notes, and snippets.

@brianredbeard
Created February 11, 2019 23:16
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 brianredbeard/2e3abe7430db6dce76ef9ce2509c47a4 to your computer and use it in GitHub Desktop.
Save brianredbeard/2e3abe7430db6dce76ef9ce2509c47a4 to your computer and use it in GitHub Desktop.
Github Pubkeys - grab all keys from a list of users to generate an authorized_keys file
#!/bin/bash
set -e -u -o pipefail
# Provide a default list of users. This can be overriden by supplying the
# environment variable "USERS"
USERS=${USERS:-'brianredbeard chancez crawford ivancherepov kbrwn'}
for name in ${USERS}; do
curl -Ls http://github.com/${name}.keys | \
sed -e "s/\$/ github-user:${name}/g" -e "s/^/ - /"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment