giip
SES Proposal
3 min read

GitHub SSH Key Registration Guide

Learn how to register an SSH key on your GitHub account to clone repositories and authenticate without entering your password every time.

๐Ÿš€ Go to GitHub SSH Settings โ†’

๐Ÿ“‹ Overview

SSH (Secure Shell) is a protocol that allows secure authentication without sending your password over the network. By registering an SSH key pair on GitHub, you can clone, pull, and push repositories without entering credentials each time.

GitHub supports two types of SSH keys:

  • Ed25519 (recommended) โ€” modern, secure, and smaller key size
  • RSA (4096-bit) โ€” legacy compatibility, use only if Ed25519 is not supported by your system

๐Ÿ› ๏ธ Setup Steps

1. Check for Existing SSH Keys

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

Linux / macOS / WSL:

ls -la ~/.ssh/

Windows (PowerShell):

Get-ChildItem $env:USERPROFILE\.ssh

Look for files named id_ed25519, id_ed25519.pub, id_rsa, or id_rsa.pub. If you already have a key pair you want to use, skip to Step 3.

2. Generate a New SSH Key

Generate a new SSH key using the Ed25519 algorithm (recommended).

Linux / macOS / WSL:

ssh-keygen -t ed25519 -C "<your-email@example.com>"

Windows (PowerShell):

ssh-keygen -t ed25519 -C "<your-email@example.com>"

When prompted for a file location, press Enter to accept the default (~/.ssh/id_ed25519).

When prompted for a passphrase, you may enter a secure passphrase or press Enter to leave it empty. Using a passphrase adds an extra layer of security.

3. View and Copy Your Public Key

Display your public key and copy it to your clipboard.

Linux / macOS / WSL:

cat ~/.ssh/id_ed25519.pub

Windows (PowerShell):

Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub

The public key starts with ssh-ed25519 or ssh-rsa and ends with your email address. Select the entire output and copy it.

โš ๏ธ Security Notice: Never share or publish your private key (id_ed25519 without .pub). Only the public key (id_ed25519.pub) is safe to share.

4. Register the Key on GitHub

  1. Log in to GitHub
  2. Click your profile photo โ†’ Settings
  3. In the left sidebar, click SSH and GPG keys
  4. Click New SSH key
  5. In the Title field, enter a descriptive label (e.g., My Laptop, Office Desktop)
  6. In the Key field, paste your public key
  7. Click Add SSH key

5. Test the Connection

Verify that your SSH key is registered correctly.

ssh -T git@github.com

You may see a warning like this the first time:

The authenticity of host 'github.com (IP ADDRESS)' can't be established.
RSA key fingerprint is SHA256:xxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

Type yes and press Enter. If successful, you will see:

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

6. Clone a Repository Using SSH

After confirming the connection, clone repositories using the SSH URL.

git clone git@github.com:<owner>/<repository>.git

Replace <owner> with the repository owner and <repository> with the repository name.

๐Ÿ” Verify SSH Key Registration

To list all registered SSH keys on your GitHub account:

  1. Go to Settings โ†’ SSH and GPG keys
  2. View the list of registered keys with their titles and creation dates

๐Ÿฉบ Troubleshooting

SymptomCauseSolution
Permission denied (publickey)No SSH key registered, or wrong key usedVerify your public key is registered on GitHub. Make sure you are using the correct private key.
ssh -T says "successfully authenticated" but git operations failKey not added to the specific repositoryEnsure your SSH key has read/write access to the repository in its settings.
Connection timeoutFirewall or network issue blocking port 22Check your network settings, or try using HTTPS instead.
git@github.com: Permission deniedWrong remote URL formatUse git@github.com: (colon) not https://github.com/ in your remote URL.
"Too many authentication failures"Server rejects due to too many key attemptsUse ssh -vT git@github.com to debug, or specify the key with -i ~/.ssh/id_ed25519.

๐Ÿ”’ Security Best Practices

  • Never share your private key (id_ed25519 or id_rsa). Do not attach it to issues, emails, or commit it to repositories.
  • Use a passphrase when generating your SSH key to protect the private key even if your machine is compromised.
  • Use a unique SSH key per device โ€” register different keys for your laptop, desktop, and servers.
  • Regularly audit registered keys โ€” remove old or unused SSH keys from your GitHub account.
  • Consider using SSH certificates for organizations that need centralized key management.

๐Ÿ“š References


Version: 1.0 Last Updated: 2026-09-24 Source: giipv3/public/help/github-ssh-key.en.md