Skip to content

Instantly share code, notes, and snippets.

@ozymandium
Created January 23, 2016 22:30
Show Gist options
  • Save ozymandium/078130fd36007af7de33 to your computer and use it in GitHub Desktop.
Save ozymandium/078130fd36007af7de33 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Register your default SSH public key with Github
#usage:
# ./github_reg_key.sh <github_username>
#
curl -u "$1" \
--data "{\"title\":\"`uname -n`_`echo $USER`_`date +%Y%m%d%H%M%S`\",\"key\":\"`cat ~/.ssh/id_rsa.pub`\"}" \
https://api.github.com/user/keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment