Setting Up SSH Keys for GitHub on Arch Linux

If you’re running Arch Linux and want to set up SSH authentication for GitHub, here’s a quick guide to get you started. This process allows you to push and pull from GitHub repositories without entering your password every time.

Prerequisites

First, you’ll need to install OpenSSH if it’s not already on your system:

sudo pacman -S openssh

Generate Your SSH Key

Create a new ED25519 SSH key pair with this command:

ssh-keygen -t ed25519 -C "[email protected]"

Replace [email protected] with your actual GitHub email. When prompted, you can accept the default location or specify a custom path. I recommend setting a passphrase for additional security.

Add the Key to SSH Agent

Start the SSH agent and add your newly created key:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

Copy Your Public Key

Display your public key:

cat ~/.ssh/id_ed25519.pub

Copy the entire output to your clipboard.

Add Key to GitHub

  1. Navigate to GitHub Settings → SSH and GPG keys
  2. Click “New SSH key”
  3. Give it a descriptive title (e.g., “Arch Linux Workstation”)
  4. Paste your public key
  5. Click “Add SSH key”

Verify the Connection

Test your SSH connection to GitHub:

You should see a success message confirming authentication.

Start Using SSH URLs

Now you can clone repositories using SSH instead of HTTPS:

git clone [email protected]:username/repository.git

That’s it! You’re all set to work with GitHub using SSH authentication on Arch Linux.

my DevOps Odyssey

“Σα βγεις στον πηγαιμό για την Ιθάκη, να εύχεσαι να ‘ναι μακρύς ο δρόμος, γεμάτος περιπέτειες, γεμάτος γνώσεις.” - Kavafis’ Ithaka.



Setting Up SSH Keys for GitHub on Arch Linux

2026-02-08

Series:lab

Categories:Linux

Tags:#ssh, #linux, #sysadmin


Setting Up SSH Keys for GitHub on Arch Linux: