How to add SSH key to my local windows pc

To add an SSH key to your local Windows PC, you can follow these steps:

  1. Open the Start menu and search for “git bash”.
  2. In the Git Bash terminal, run the following command to generate a new SSH key:
ssh-keygen -t rsa
  1. Press “Enter” to accept the default location for the key file, or specify a different location by entering the path.
  2. Enter a passphrase for the key. This is optional, but it can help to add an extra layer of security to your SSH key.
  3. Copy the SSH key to the clipboard using the “clip” command:
clip < ~/.ssh/id_rsa.pub
  1. Open a web browser and navigate to the website where you want to use the SSH key (such as GitHub).
  2. Sign in to your account and navigate to the “Settings” or “Profile” page.
  3. Look for an option to add an SSH key, such as “SSH and GPG keys” or “SSH keys”.
  4. Click the “Add SSH key” button and paste the SSH key from the clipboard into the “Key” field.
  5. Give the key a descriptive name (such as “My Windows PC”) and click the “Add key” button.

That should add the SSH key to your local Windows PC and associate it with your account on the website. You should now be able to use the key to authenticate SSH connections.

I have SSH key generated from my server, how can i add that key to my pc

To add an SSH key that was generated on a server to your local PC, you can follow these steps:

  1. Connect to the server using SSH and view the contents of the key file. For example:
cat ~/.ssh/id_rsa.pub
  1. Copy the contents of the key file to the clipboard. This will typically be a long string of characters starting with “ssh-rsa”.
  2. On your local PC, open the Start menu and search for “git bash”.
  3. In the Git Bash terminal, create a new directory for the SSH keys if it does not already exist:
mkdir ~/.ssh
  1. Open the authorized_keys file in a text editor:
Copy codenano ~/.ssh/authorized_keys
  1. Paste the contents of the key file into the authorized_keys file and save the file.
  2. Set the correct permissions for the SSH keys directory:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

That should add the SSH key from the server to your local PC. You should now be able to use the key to authenticate SSH connections to the server.

Related Articles

Responses

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