Authenticate to GitHub using SSH Protocol — Step By Step

Yair Nevet
Jun 11, 2023

--

  1. On your MacOs terminal, run the following command in order to generate public/private ed25519 key pair:
    ssh-keygen -t ed25519 -C “you@domain.com”
  2. There will be multiple prompt questions, you can ignore all of them by pressing the return key
  3. Copy the newly generated public key by executing the following command:
    pbcopy < ~/.ssh/id_ed25519.pub
  4. Go to your GitHub account, go to Settings, under the Access section, select SSH and GPG Keys
  5. Click on New SSH Key
  6. Enter any title you want, in the key type select Authentication Key, and paste the copied public key into the Key field (Note that you might be needed to configure SSO for your new key, depends on the Organization you’re associated with)
  7. Now you’ll be able to clone your repositories with their SSH address successfully, example:
    git clone git@github.com:your-user-name/your-repo.git

--

--