Are you tired of having to type your GitHub password every time you need to push changes to your repository? SSH keys offer a secure and convenient way to authenticate with GitHub. In this guide, we'll walk you through the process of generating and adding SSH keys to your GitHub account.

Before we dive in, ensure that you have Git installed on your computer. You can download and install Git from the official Git website.

Generating SSH Key Pairs
First, we need to generate a new SSH key pair on your local machine. Open your terminal or command prompt and type the following command:

ssh-keygen -t ed25519 -C "your_email@example.com"
Understanding the Command

Here's what the command does:
ssh-keygen- Invokes the SSH key generation utility.-t ed25519- Specifies the type of key to generate. Ed25519 is a fast and secure key type.-C "your_email@example.com"- Sets a comment/label for the key, which is useful for identifying it later.
Saving and Naming Your Key

When prompted, choose a file location to save your key. By default, it will be saved in ~/.ssh/id_ed25519. You can also add a passphrase for an extra layer of security. Make sure to remember this passphrase!
Adding SSH Key to GitHub
Now that we have our SSH key pair, let's add it to GitHub. First, add the public key to the SSH agent:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519




















Displaying Public Key
Copy the public key content:
pbcopy < ~/.ssh/id_ed25519.pub
Pasting Public Key to GitHub
Go to your GitHub profile, click on "Settings", then "SSH and GPG keys". Click on "New SSH key", give it a title, and paste the key content in the "Key" field. Click "Add key" to save it.
Now, you can use the ssh -T git@github.com command to verify that your SSH key is working. You should see a "Success" message. Finally, configure Git to use your SSH key for authentication:
git config --global user.name "Your Name"
git config --global user.email "your_email@example.com"
You're all set! From now on, you can push changes to your GitHub repositories using SSH keys. Happy coding!