Generating a new SSH key and adding it to the ssh-agent in Mac
Khairun Nahar Nowrin
Posted on May 8, 2024
- Go to github profile
- Go to Profile settings
- Then click on SSH and GPG keys
- Open you mac terminal and Paste the text below, replacing the email used in the example with your GitHub email address
ssh-keygen -t ed25519 -C "your_email@example.com"
- After Run the command it show
- After that it generate SHA256
7.Start the ssh-agent in the background.
$ eval "$(ssh-agent -s)"
> Agent pid 59566
- Run
open ~/.ssh/config
If the file doesn't exist, create the file.
touch ~/.ssh/config
- Open ~/.ssh/config file, then modify the file to contain the following lines. If your SSH key file has a different name or path than the example code, modify the filename or path to match your current setup.
Text
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
- Run
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
If it show error like
Then run
ssh-keygen -t ed25519 -C Your_github_emailr@gmail.com
Then run
- Go to your git hub account and click on "New SSH key"
- Provide title and key.
- For "key" open .ssh > id_ed25519.pub
Now clone a project from your github repository
git clone git@github.com:KhairunNaharNowrin/End-to-End-Testing-With-Cypress.git
- Setup the project environment
- Run
git add .
git commit -m "set up environment"
It will show error like "Author identity unknown"
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
git push
reference -
💖 💪 🙅 🚩
Khairun Nahar Nowrin
Posted on May 8, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024