SSH keys and GitHub

Load your SSH key automatically

Stop typing your key's passphrase every time: let the SSH agent remember it.

  1. Tell SSH to use the macOS Keychain
    Terminal
    cat >> ~/.ssh/config <<'EOF'
    Host *
      AddKeysToAgent yes
      UseKeychain yes
      IdentityFile ~/.ssh/id_ed25519
    EOF
  2. Save the passphrase in the Keychain once
    Terminal
    ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Check it worked

  1. Check the key is loaded
    Terminal
    ssh-add -l
  1. Add the key to the agent the first time you use it
    Terminal · Ubuntu / Debian
    cat >> ~/.ssh/config <<'EOF'
    Host *
      AddKeysToAgent yes
    EOF

    Ubuntu Desktop already runs an SSH agent when you log in.

  2. Load it now
    Terminal · Ubuntu / Debian
    ssh-add ~/.ssh/id_ed25519

Check it worked

  1. Check the key is loaded
    Terminal · Ubuntu / Debian
    ssh-add -l
  1. Start the SSH agent automaticallyRun as administrator
    PowerShell
    Get-Service ssh-agent | Set-Service -StartupType Automatic
    Start-Service ssh-agent
  2. Load your key (once; it's remembered)
    PowerShell
    ssh-add "$env:USERPROFILE\.ssh\id_ed25519"

Check it worked

  1. Check the key is loaded
    PowerShell
    ssh-add -l