Created
March 17, 2020 07:17
-
-
Save delfer/2d6d0b4f34e10b9389f7e7c2d06ecf56 to your computer and use it in GitHub Desktop.
Import keys from GitHub accounts to SSH authorized_keys
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
#!/bin/sh | |
#set user or user list!!! | |
USERS="delfer user2 user3" | |
mkdir ~/.ssh || true | |
for USER in $USERS; do | |
URL=https://github.com/${USER}.keys | |
STORE=~/.ssh/authorized_keys | |
echo "# $URL" >> $STORE | |
curl -L $URL >> $STORE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment