Enhance your workflow with secure, password-free GitHub authentication on Arch Linux. This guide walks you through setting up SSH keys and seamlessly integrating GNOME Keyring for a hassle-free experience on XFCE.
Part 1: Setting Up SSH with GitHub
Step 1: Generate an SSH Key
Run the following command to generate a new SSH key:
ssh-keygen -t ed25519 -C "user@arch.linux"
-
-t ed25519: Uses the secure Ed25519 algorithm. -
-C "user@arch.linux": Labels the key with your email.
Follow the prompts to save the key (default location: ~/.ssh/id_ed25519).
Step 2: Start the SSH Agent
To manage SSH keys in memory, start the SSH agent:
eval "$(ssh-agent -s)"
Step 3: Add Your SSH Key to the Agent
ssh-add ~/.ssh/id_ed25519
Step 4: Copy and Add Your Public Key to GitHub
cat ~/.ssh/id_ed25519.pub
Copy the output and go to GitHub → Settings → SSH and GPG keys → New SSH Key, paste it, and save.
Step 5: Test Your SSH Connection
ssh -T git@github.com
A successful connection returns a GitHub welcome message.
Step 6: Configure SSH (Optional)
To avoid manually specifying the SSH key, create a configuration file:
touch ~/.ssh/config
nano ~/.ssh/config
Add:
Host github.com
IdentityFile ~/.ssh/id_ed25519
AddKeysToAgent yes
Save and exit.
Step 7: Re-Test SSH Connection
Run:
ssh -T git@github.com
Your SSH setup is now complete!
Part 2: Enabling GNOME Keyring for Passwordless SSH on Arch XFCE
To have your SSH keys unlocked automatically at login, configure GNOME Keyring.
Step 1: Disable XFCE's Default SSH Agent
Run:
xfconf-query --channel xfce4-session --property /startup/ssh-agent/enabled --create --type bool --set false
Step 2: Install GNOME Keyring
Using an AUR helper like paru:
paru -S gnome-keyring seahorse
This provides gpg-agent, which will act as your SSH agent.
Step 3: Set the SSH_AUTH_SOCK Environment Variable
The SSH_AUTH_SOCK environment variable tells SSH tools where to find the authentication agent. Since GPG agent is being used as the SSH agent, this variable must point to its socket:
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
To make this change persistent across reboots, add this line to your ~/.bashrc or ~/.zshrc file.
Step 5: Add Your SSH Key to the Agent
Now that GPG agent is running with SSH support, add your SSH key:
ssh-add ~/.ssh/id_ed25519
- If your key has a passphrase, you will be prompted.
- The passphrase will be cached according to GPG agent settings.
Step 7: Verify the Key Is Loaded
To confirm that your key has been added successfully, run:
ssh-add -l
- If your key is listed, it means GPG agent is managing it correctly.
- If no keys appear, ensure that GPG agent is running and
SSH_AUTH_SOCKis set correctly.
Your SSH keys are now managed by GNOME Keyring (GPG Agent), providing a secure and consistent authentication experience. 🎉
Top comments (0)