Skip to main content

Adding an SSH Key to Github

Follow the steps below to add a SSH public key to GitHub to enable git clone using SSH. The key once added to GitHub will need to be authorised using SSO.

  1. ssh-keygen -t ed25519 -C "name@digital.justice.gov.uk"

  2. Press enter until the SSH key is created.

  3. eval "$(ssh-agent -s)"

  4. ssh-add ~/.ssh/id_ed25519

  5. more ~/.ssh/id_ed25519.pub | pbcopy

  6. Paste the text somewhere and it should be in this format: ssh-ed25519 HEX-VALUE name@digital.justice.gov.uk

  7. Add the new ssh key in https://github.com/settings/keys

  8. Click on the Configure SSO button to authorise the key.

  9. You should recieve an email that a key was added to your account.

  10. Try git clone git@github.com:ministryofjustice/moj-org-discussions.git

This page was last reviewed on 5 March 2024. It needs to be reviewed again on 5 March 2025 by the page owner #operations-engineering-alerts .
This page was set to be reviewed before 5 March 2025 by the page owner #operations-engineering-alerts. This might mean the content is out of date.