DEV Community

Cover image for How to Set Up GitHub with SSH Keys on Windows 10 or 11
Adnan al-emran ontor
Adnan al-emran ontor

Posted on

How to Set Up GitHub with SSH Keys on Windows 10 or 11

Why Use RSA with SSH Keys?

RSA (Rivest-Shamir-Adleman) encryption is one of the most widely supported algorithms for SSH keys. It provides a balance between strong security and compatibility, making it ideal for authenticating with services like GitHub.

Step-by-Step Guide

  1. Generate an SSH Key To generate an RSA SSH key with your email as a comment, follow these steps:

Open Command Prompt or PowerShell on Windows 10.

Type the following command to create a new SSH key using RSA encryption:

ssh-keygen -o -t rsa -C "youremail@email.com"

Image description

  • When prompted to specify a location to save the key, press Enter to use the default directory (C:\Users\YourUsername.ssh\id_rsa).

  • Press Enter (no passphrase needed).

like :
Image description

  1. Access the SSH Key Navigate to the .ssh folder located in:

C:\Users\YourUsername.ssh\

like :

Image description

Open the id_rsa.pub file with Notepad and copy the public key.

Image description

  1. Add the SSH Key to GitHub Now, you need to add the SSH public key to your GitHub account.

Go to your GitHub profile.

Navigate to Settings > SSH and GPG keys.

Image description

  • Click New SSH Key.

Image description

  • Paste the SSH public key in the "Key" field and give it a meaningful title.
    Image description

  • Click Add SSH key, and you're done!
    Image description

use SSH :
Image description

Top comments (0)