Skip to content

Instantly share code, notes, and snippets.

@jasonwc
Last active April 2, 2020 22:44
Show Gist options
  • Save jasonwc/e6e907a8e9abfcf2eb806e910d95baf1 to your computer and use it in GitHub Desktop.
Save jasonwc/e6e907a8e9abfcf2eb806e910d95baf1 to your computer and use it in GitHub Desktop.
Fix SSH key permissions
# After adding keys to a new shell
# wget -O - https://gist.githubusercontent.com/jasonwc/e6e907a8e9abfcf2eb806e910d95baf1/raw/a0e9241725ba2dd6c541602858abd455ae9bc732/fix-ssh-key.sh | bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
echo "Fixing permissions of ssh keys..."
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment