Steps To Generating and Adding a New SSH Key
I recently bought a new computer and needed to connect it to GitHub. It’s been a while since I had done this so it took me a few hours to get it done. I’m wirting it done so you and I don’t have to spend countless hours of research next time.
Steps To Generate a New SSH Key
- Open Git Bash
- Paste the following command: ssh-keygen -t ed25519 -C “youremail@domain.com”
- Replace the generic email with the email address you have in GitHub
- Click enter to save key in suggested location
- Create a passphrase and enter it
- write it down somewhere safe that you can access
- you will be asked to type it in twice
- Then run this command: clip < ~/.ssh/id_ed25519.pub
- The system will copy the SSH key to your clipboard to then copy in Github
Steps To Add New Key To GitHub
- Add the new SSH key to GitHub by going to your settings > SSH Keys & GPG Keys > New SSH Key
- Add a relevant title for SSH key… example “Personal Laptop 2024”
- Paste the SSH in the “Key” section
The device should now be added and connected to GitHub!
Cheers,
Gaby