Skip to content

Instantly share code, notes, and snippets.

@delfer
Created March 17, 2020 07:17
Show Gist options
  • Save delfer/2d6d0b4f34e10b9389f7e7c2d06ecf56 to your computer and use it in GitHub Desktop.
Save delfer/2d6d0b4f34e10b9389f7e7c2d06ecf56 to your computer and use it in GitHub Desktop.
Import keys from GitHub accounts to SSH authorized_keys
#!/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