Skip to content

GitHub SSH Key Configuration

NVIDIA DGX Cloud only!

This page provides resources for using the NVIDIA DGX Cloud, and is not intended for HiPerGator users!

To push changes to GitHub, you need to set up SSH Keys to connect your GitHub account with the NVIDIA servers. Here are the instructions for that:

Step 0: Configure Git username and email

Before you start using Git, you need to tell it who you are. This ensures that when you make commits, they are associated with you.

  1. Open Terminal.
  2. Type the following two commands, replacing your name (in quotes because there's a space) and email.

    git config --global user.name "John Doe"
    git config --global user.email johndoe@example.com
    

    If you need more information. Please check out Git's First-Time User Guide.

Step 1: Check for existing keys (see GitHub page here)

  1. Open Terminal.
  2. Type ls -al ~/.ssh to see if existing SSH keys are present.

    ls -al ~/.ssh
    # Lists the files in your .ssh directory, if they exist
    
  3. Check the directory listing to see if you already have a public SSH key. By default, the filenames of supported public keys for GitHub are one of the following.

    • id_rsa.pub
    • id_ecdsa.pub
    • id_ed25519.pub

    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.

    If you do have one of the above files, you can skip step 2, as you already have an SSH key pair to use.

Step 2: Create an SSH key pair (see GitHub page here)

  1. Open Terminal.
  2. Paste the text below, replacing the email used in the example with your GitHub email address.

    ssh-keygen -t ed25519 -C "your_email@example.com"
    

    This creates a new SSH key, using the provided email as a label.

    > Generating public/private ed25519 key pair.
    

    When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location.

  3. At the prompt, type a secure passphrase or leave it blank and press Enter. While SSH keys with a blank passphrase are less secure, they are easier to use as you do not need to type the passphrase every time you want to use the keys. For more information, see Working with SSH key passphrases.

    > Enter passphrase (empty for no passphrase): [Type a passphrase]
    > Enter same passphrase again: [Type passphrase again]
    

Step 3: Add your SSH key to your GitHub profile (see GitHub page here)

  1. These directions are a bit different than on GitHub, but tend to work more consistently.
  2. Use the cat command to display the contents of the public key:

    cat ~/.ssh/id_ed25519.pub
    # Displays the contents of the public key created above.
    

    You will see something like:

    ssh-ed25519 AAAAC3NzaC1lDZI3NTE5AAAAIF5iq9uDYRDFgZYUBPy0vnJNMe/nGkVWOl/hwAJorSHE magitz@ufl.edu
    
  3. Copy that line of text. That is the public key that you will add to your GitHub profile.

  4. Return to your browser, and in the upper-right corner of any page on GitHub, click your profile photo and then click Settings.
  5. In the "Access" section of the left sidebar, click SSH and GPG keys.
  6. Click New SSH key or Add SSH key.
  7. In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal laptop, you might call this key "Personal laptop".
  8. Keep the type of key set to Authentication.
  9. In the "Key" field, paste your public key (the line of text copied above).
  10. Click Add SSH key.
  11. If prompted, confirm access to your account on GitHub.

Step 4: Test your SSH key (See GitHub page here)

  1. Open Terminal.
  2. Enter the following (yes, keep the user as git@github.com):

    ssh -T git@github.com
    # Attempts to ssh to GitHub
    

    You may see a warning like this

    > The authenticity of host 'github.com (IP ADDRESS)' can't be established.
    > ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
    > Are you sure you want to continue connecting (yes/no)?
    

    Verify that the fingerprint in the message you see matches GitHub's public key fingerprintLinks to an external site.. If it does, then type yes

    You should see something like:

    > Hi USERNAME! You've successfully authenticated, but GitHub does not
    > provide shell access.
    

    The USERNAME will have your GitHub username. This is your indication that things are correctly configured and you are ready to go to the next step.