Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.58 KB

using-ssh-for-github.org

File metadata and controls

59 lines (40 loc) · 1.58 KB

How-to enable public/private keys for github.

Create a private key and add it to your agent

Create a private key and add it to your agent.

TLDR:

$ ssh-keygen -t ed25519 -C "[email protected]"

I had to type passphrase.

This created:

~/.ssh/
  id_ed25519
  id_ed25519.pub

Verify ssh-agent is running.

$ ps -Af | grep ssh-agent
robert    212144  212080  0 14:49 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/im-launch env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/gnome-session --session=ubuntu
robert    213375  212558  0 14:57 pts/0    00:00:00 grep --color=auto ssh-agent

Add your new private key.

$ ssh-add ~/.ssh/id_ed25519

Add the public key to github account:

Add a public key to github.

$ xclip -selection clipboard < ~/.ssh/id_ed25519.pub

Navigate github to reach the page that lets you add an ssh key. I named mine “desktop”. Paste in the key from the clipboard.

Enable git command line to use ssh instead of https

Had to add the following to ~/.gitconfig

## Github
[url "ssh://[email protected]/"]
     insteadOf = https://github.com/

git push now works without prompts. I may have to enter passphrase when the agent decides to ask me.