Skip to content

Instantly share code, notes, and snippets.

@dsmith73
Created April 5, 2020 14:54
Show Gist options
  • Save dsmith73/25faae42e9a6233dcbeb66aedee02606 to your computer and use it in GitHub Desktop.
Save dsmith73/25faae42e9a6233dcbeb66aedee02606 to your computer and use it in GitHub Desktop.
ssh - pushing to github without typing in credentials

ssh - pushing to github without typing in credentials

Connecting to GitHub with SSH https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

Windows - This presumes that you aren't creating a pass-phrase. If you are, there are different steps in the link above.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

# start the ssh-agent in the background
$ eval $(ssh-agent -s)
> Agent pid 59566

ssh-add ~/.ssh/id_rsa

$ clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

Open github goto account > settings > SSH and GPG keys > New SSH key or Add SSH key

In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".

Paste your key into the "Key" field

click Add SSH key

confirm your GitHub password if prompted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment