Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active December 18, 2020 09:25
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 ruzickap/80ee2292ebf697a0ec05dd4752516464 to your computer and use it in GitHub Desktop.
Save ruzickap/80ee2292ebf697a0ec05dd4752516464 to your computer and use it in GitHub Desktop.
deploy-public-ssh-key-github.sh
GITHUB_USERNAME="${GITHUB_USERNAME:-ruzickap}"
DESTINATION_DIRECTORY="${DESTINATION_DIRECTORY:-/root/.ssh}"
[[ ! -d "${DESTINATION_DIRECTORY}" ]] && mkdir -v --mode=0700 "${DESTINATION_DIRECTORY}"
wget "https://github.com/${GITHUB_USERNAME}.keys" -O "${DESTINATION_DIRECTORY}/authorized_keys"
chmod 0600 "${DESTINATION_DIRECTORY}/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment