Prompt Title: Link GitHub Account with Windows

Created 10 months ago
Votes 0
Views 158 times
0

Prompt Detail:

To link your GitHub account with your Windows computer using SSH, you need to follow these steps:

Step 1: Check for existing SSH keys

  1. Open the Command Prompt (CMD) on your Windows computer.

  2. Enter the following command to check if you already have SSH keys set up:

bash
dir %userprofile%\.ssh
Save to grepper

This command lists the files in the .ssh directory, if it exists. Look for files with names like id_rsa (private key) and id_rsa.pub (public key).

  • If the .ssh directory does not exist, or if there are no files present, you need to generate a new SSH key pair.
  • If you already have SSH keys, you can skip to Step 3.

Step 2: Generate a new SSH key pair (if needed)

  1. Enter the following command to generate a new SSH key pair:
css
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Save to grepper

Replace "[email protected]" with the email address associated with your GitHub account.

  1. Press Enter to accept the default location and file names suggested by the command. You can also specify a different file location or key name if desired.

  2. When prompted, enter a secure passphrase for the key. This adds an extra layer of security.

  3. The command will generate two files: id_rsa (private key) and id_rsa.pub (public key) in the .ssh directory.

Step 3: Add the SSH key to your GitHub account

  1. Copy the contents of the public key file (id_rsa.pub).

  2. Open your web browser and go to the GitHub website (https://github.com).

  3. Log in to your GitHub account (if you haven't already).

  4. Click on your profile icon in the top right corner, then select "Settings" from the dropdown menu.

  5. In the left sidebar, click on "SSH and GPG keys."

  6. Click on the "New SSH key" button.

  7. Provide a descriptive title for the SSH key (e.g., "My Windows PC").

  8. Paste the contents of the public key file (id_rsa.pub) into the "Key" field.

  9. Click on the "Add SSH key" button.

Step 4: Test the SSH connection

  1. Return to the Command Prompt (CMD).

  2. Enter the following command to test the SSH connection to GitHub:

css
ssh -T git@github.com
Save to grepper
  1. If this is your first time connecting to GitHub, you may see a message asking you to verify the authenticity of the host. Type "yes" and press Enter to continue.

  2. If everything is set up correctly, you should see a message like:

vbnet
Hi <your_username>! You've successfully authenticated, but GitHub does not provide shell access.
Save to grepper

Congratulations! You have successfully linked your GitHub account with your Windows computer using SSH.

Now you can clone, push, or pull repositories using the SSH URLs provided by GitHub.

avatar
Rohan
Shared 5 prompts
Created 10 months ago

Leave a Comment

Related Tag Prompts

0
0
GitHub Actions with Comments.
1 year ago 2023-03-30 13:07:36 Félix Paradis
0
0
Git Tagging Types.
1 year ago 2023-03-31 09:44:34 murali
0
0
0
0
Sync GitHub Accounts.
11 months ago 2023-05-12 02:34:38 Shiva Aryal
0
0
Versioning Action
3 months ago 2024-01-09 19:21:24 Asher