Skip to content

Instantly share code, notes, and snippets.

@David-Lor
Last active November 12, 2019 20:51
Show Gist options
  • Select an option

  • Save David-Lor/7eaef0421bbebb3060acb9eac368a420 to your computer and use it in GitHub Desktop.

Select an option

Save David-Lor/7eaef0421bbebb3060acb9eac368a420 to your computer and use it in GitHub Desktop.
Setup Github SSH key
#!/bin/bash
set -ex
ssh-keygen -f "$HOME/.ssh/github.priv"
mv "$HOME/.ssh/github.priv.pub" "$HOME/.ssh/github.pub"
echo "Host github.com" >> "$HOME/.ssh/config"
echo " IdentityFile ~/.ssh/github.key" >> "$HOME/.ssh/config"
echo "Public key:"
cat "$HOME/.ssh/github.pub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment