Test Automation Hub

9717792633
support@testautomationhub.com
+91 9717792633
support@testautomationhub.com

Setting up SSH keys for GitHub allows you to securely authenticate without needing to enter your username and password every time. Here’s a step-by-step guide documentation and video:

Step 1: Check for existing SSH keys

Before generating a new key, check if you already have one:

If you see files like id_rsa.pub or id_ed25519.pub, you already have a key.

Step 2: Generate a new SSH key

If you don’t have a key or want to create a new one, run the following command (replace your_email@example.com with your GitHub email):

If your system doesn’t support ed25519, you can use RSA instead:

  1. When prompted, choose a file to save the key (/home/you/.ssh/id_ed25519 or the default).
  2. Enter a passphrase (optional but recommended).

Step 3: Add your SSH key to the ssh-agent

To ensure the SSH key is used, add it to the ssh-agent:

  1. Start the ssh-agent in the background:
  1. Add your SSH key to the agent:

(Or ~/.ssh/id_rsa if using RSA.)

Step 4: Add the SSH key to your GitHub account

Now, you need to add the SSH public key to GitHub:

  1. Copy the SSH public key to your clipboard:

(Or ~/.ssh/id_rsa.pub.)

  1. Log into GitHub, go to Settings > SSH and GPG keys > New SSH key.
  2. Paste your key and save.

Step 5: Test the SSH connection

To confirm that everything is set up properly, run:

You should see a message like this:

bashCopy codeHi your_username! You've successfully authenticated, but GitHub does not provide shell access.

This confirms that SSH is set up correctly for GitHub.

 

One Response

Leave a Reply to A WordPress Commenter Cancel reply

Your email address will not be published. Required fields are marked *