Created
January 27, 2017 15:09
-
-
Save g105b/0986281be735be00775c598581ddb2eb to your computer and use it in GitHub Desktop.
Sync authorized_keys with Github public keys
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 | |
GITHUB_USERNAME=#PUT_YOUR_USERNAME_HERE | |
TMP=/tmp/existing_cron | |
crontab -l > $TMP | |
echo "*/10 * * * * /usr/bin/wget https://github.com/$GITHUB_USERNAME.keys -O ~/.ssh/authorized_keys" >> $TMP | |
crontab $TMP | |
rm $TMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a really rough method of keeping your authorized_keys file in sync with the public keys on your Github account. Currently drops any existing keys in the file, so this is only useful if you use Github as your primary key storage area.