1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Files
docs/content/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys.md
Laura Coursen 8f964ea2cb GHEC version (#20947)
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Steve Guntrip <12534592+stevecat@users.noreply.github.com>
Co-authored-by: Robert Sese <sese@github.com>
Co-authored-by: Peter Bengtsson <peterbe@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-10-15 15:41:33 -05:00

2.0 KiB

title, intro, redirect_from, versions, topics, shortTitle
title intro redirect_from versions topics shortTitle
Checking for existing SSH keys Before you generate an SSH key, you can check to see if you have any existing SSH keys.
/articles/checking-for-existing-ssh-keys
/github/authenticating-to-github/checking-for-existing-ssh-keys
/github/authenticating-to-github/connecting-to-github-with-ssh/checking-for-existing-ssh-keys
fpt ghes ghae ghec
* * * *
SSH
Check for existing SSH key

{% data reusables.ssh.key-type-support %}

{% data reusables.command_line.open_the_multi_os_terminal %} 2. Enter ls -al ~/.ssh to see if existing SSH keys are present.

$ ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
  1. Check the directory listing to see if you already have a public SSH key. By default, the {% ifversion ghae %}filename of a supported public key for {% data variables.product.product_name %} is id_rsa.pub.{% elsif fpt or ghes %}filenames of supported public keys for {% data variables.product.product_name %} are one of the following.
    • id_rsa.pub
    • id_ecdsa.pub
    • id_ed25519.pub{% endif %}

{% tip %}

Tip: If you receive an error that ~/.ssh doesn't exist, you do not have an existing SSH key pair in the default location. You can create a new SSH key pair in the next step.

{% endtip %}

  1. Either generate a new SSH key or upload an existing key.
    • If you don't have a supported public and private key pair, or don't wish to use any that are available, generate a new SSH key.

    • If you see an existing public and private key pair listed (for example, id_rsa.pub and id_rsa) that you would like to use to connect to {% data variables.product.product_name %}, you can add the key to the ssh-agent.

      For more information about generation of a new SSH key or addition of an existing key to the ssh-agent, see "Generating a new SSH key and adding it to the ssh-agent."