Blog Datasheets Home About me Clients My work Services Contact

G2Labs Grzegorz Grzęda

Set up github keys

April 21, 2023

When I want to set up my new Linux environment for using my GitHub resources, I need to set up a secure key to authenticate.

I set separate key for each environmnent, minimising the possibility of breach.

Local set up

I generate a new key, using my email, by which I log in to github:

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

On prompt, I use the default settings, regarding file location and I don’t set up the passphrase (my computer passwords are secure enough to store those keys safely).

Next, I check if the ssh-agent is running (example response):

1
2
$ eval "$(ssh-agent -s)"
> Agent pid 59566

If so, I add my fresh generated key to the ssh-agent. Here, as the password file was generated with default name, I add it as so:

1
$ ssh-add ~/.ssh/id_ed25519

Adding key information to github account

I copy the content of the public part of key to clipboard (using default file name):

1
$ clip < ~/.ssh/id_ed25519.pub

Next, I do:

  1. head to my github account
  2. Settings
  3. SSH and GPG keys
  4. New SSH key or Add SSH key
  5. In Title add some relevant description
  6. Paste the key public part content from clipboard to Key area
  7. Click Add SSH Key
  8. When asked authenticate with GitHub account.

Now I can enjoy my new environment able to access my github content.


➡️ Writing clean and SOLID code in object-oriented programming


⬅️ Embracing the Interface Segregation Principle in your codebase


Go back to Posts.