Adding an SSH key to your GitHub account from a MacBook
Adding an SSH key to your GitHub account from a MacBook involves a few steps. Here's a guide:
Open Terminal on your MacBook.
Generate SSH Key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Start the SSH agent:
eval "$(ssh-agent -s)"
Add SSH private key to the agent:
ssh-add -K ~/.ssh/id_rsa
Copy SSH public key to clipboard:
pbcopy < ~/.ssh/id_rsa.pub
Log in to your GitHub account in a web browser.
Go to "Settings" by clicking on your profile icon in the top-right corner and selecting "Settings".
In the left sidebar, click on "SSH and GPG keys".
Click on the "New SSH key" button.
In the "Title" field, add a descriptive label for your SSH key (e.g., MacBook).
Paste your SSH key into the "Key" field. You can paste it directly from your clipboard.
Click the "Add SSH key" button.
GitHub will prompt you to confirm adding the SSH key. Enter your GitHub password to confirm.
Verify the SSH key:
ssh -T git@github.com
That's it! Your SSH key should now be added to your GitHub account.
Subscribe to my newsletter
Read articles from Amrit Adhikari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by