Skip to content

Latest commit

 

History

History
87 lines (54 loc) · 2.91 KB

File metadata and controls

87 lines (54 loc) · 2.91 KB

GitHub Authentication - GitHub SSH Keys (Authentication Key)

Set up SSH keys

Generating a new SSH key:

ssh-keygen -t ed25519 -C "your_email@example.com"

NOTE: You can press enter for all prompts or configure it your way.

Add private key to the authentication agent:

ssh-add

NOTE: This step is a reference to that point in the github documentation.

Check your ~/.ssh directory:

ls -lthr ~/.ssh

You should see these two files:

id_ed25519.pub
id_ed25519

The id_ed25519.pub is your public key, this is the key that must be defined in your Github Settings / SSH and GPG keys.

The id_ed25519 is your private key, once generated, you should not take any action on it, just keep it safe.

Add SSH key in GitHub account - Authentication Key

Once the new SSH keys are generated, you can add them to your Github account in the following ways:

Using GitHub web browser

Go to SSH and GPG keys in Github Settings panel:

new-ssh-key

Within the Keys panel, click in New SSH key to create a new key:

add-new-ssh-key-authentication-key

  • In the Title field add a name for your SSH key, I recommend something similar to this:
 Github SSH Auth Key
  • In the Key Type field, select Authentication Key, which is the default value.

  • In the Key field, add the value of ~/.ssh/id_ed25519.pub, which is something like this:

Run:

cat ~/.ssh/id_ed25519.pub

Public key output example:

ssh-ed25519 XXXXX your_email@example.com

NOTE: In the Key field we always put the value of the public key, it's something a little confusing, but it's well documented.

Using GitHub CLI

After adding a new SSH authentication key to your account on GitHub.com, you can reconfigure any local repositories to use SSH. For more information, see Managing remote repositories.

Source: