Remember when GitHub allowed simple browser logins? Yeah, those days are gone.
Now, to push code, you need SSH keys.
Recently, I hit a roadblock trying to push my code to GitHub, and I felt the same frustration you've probably experienced.
But don’t worry—this step-by-step guide will show you exactly 'How to configure SSH for GitHub access on Windows', with an easy-to-follow demo.
Steps to follow:
This setup allows for password-less authentication and secures communication between the local machine and GitHub.
1. Open Git Bash > Click on the Start Menu > Search for Git Bash > Click to open Git Bash.
2. Check if you already have existing SSH Keys to avoid overwriting them. Or else, create a new SSH key.
3. Generate a New SSH Key. Run the SSH key generation command 'sh-keygen -t ed25519 -C "your_email@example.com"'
If 'ed25519' is not supported, use 'RSA'
Ex- ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Enter the file in which you want to save the key. Then, press 'Enter' to accept the default location.
NOTE: Replace "your_email@example.com" with your GitHub email.
4. Start the SSH Agent
Expected Output: Agent pid 12345
This command starts the SSH agent in the background.
5. Add Your SSH Private Key to the Agent
Note: Replace 'id_ed25519' with your key filename if it's different.
Now that the SSH agent is running, add your SSH key to it.
6. Verify the Key Has Been Added.
Expected Output: 256 SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx your_email@example.com (ED25519)
7. Copy Your Public SSH Key to the Clipboard.
8. Add the SSH Key to Your GitHub Account.
Click on your profile picture (top-right corner) and select 'Settings'.
9. Navigate to SSH and GPG Keys.
In the left sidebar, click 'SSH and GPG keys'.
10. Click on 'New SSH key' Button.
11. Enter a descriptive title.
12. After pasting your key in the textbox, press the 'Add SSH Key' button.
13. You may see: (First-Time Connection Warning).
Then type 'yes' and press Enter.
Expected Output: "Hi username! You've successfully authenticated, but GitHub does not provide shell access."
That's All!
We have successfully configured SSH keys on our Windows laptops to secure GitHub access.
And there you have it—setting up SSH for GitHub on Windows is no longer a mystery.
Now, pushing code will be smooth, and you'll save tons of time in the long run.
Whether you're working solo or contributing to an open-source project, this setup makes life a lot easier. Follow these steps, and you’ll be up and running in no time!
Still have questions?
Send an email to archana@leadwalnut.com, OR
Book a FREE consultation with an expert developer here.