In this article, we will provide the procedure to run the ssh-add key in Windows
How to Run ssh-add on Windows?
In order to run the ssh-add key on Windows, you need to fulfill the prerequisites and follow the instructed steps below.
Prerequisites
Make sure you installed Git on your Windows; if you do not have it already, follow our dedicated link for Git installation and then add its path on Windows.
After fulfilling the given prerequisites, check out the given instructions.
Step 1: Launch Git Bash
Launch “Git Bash” using the Startup menu:
Step 2: Generate ssh Key-pair
Specify your email address in the given command to generate ssh key-pair:
It will then ask to create the passphrase and re-enter it for confirmation:
The given output indicates that the ssh key-pair account is successfully generated.
Step 3: Start ssh-agent
Start the ssh-agent by using the command in the Git bash:
This will start the ssh-agent in Git Bash
Step 4: Run ssh-add Command
Now, add the generated ssh key pairs to ssh authentication agent, and enter the passphrase to proceed:
Step 5: Copy Public Key to Clipboard
Copy the public key to the clipboard to paste it into the GitHub account. To do so, execute the provided command on the Git Bash console:
As a result, the generated public key will be copied to the clipboard
How to Add a Public Key to GitHub Account?
Firstly, log in to your GitHub account, click on your profile icon, and select the “Settings” option from the drop-down menu:
In the opened window, write the title of your choice, paste the copied key, and click on the “Add SSH key” button:
As you can see the copied public key has been added successfully:
We have provided the details related to executing the ssh-add command on Windows.
Conclusion
In order to run the ssh-add key in Windows, first of all, you need to have Git installed and then add the Git path to the Windows environment variables. After fulfilling the prerequisites, generate the key pair with the help of the ssh-agent, and add the generated public key to the GitHub account. This manual taught you related to run the ssh-add key on Windows.