-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux ssh add Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to ssh-add on Linux, covering Arch Linux, CachyOS, and other distributions including adding SSH keys to agent, key management, and passwordless authentication.
ssh-add adds SSH keys to ssh-agent.
Uses:
- Add keys: Add keys to agent
- Key management: Manage loaded keys
- Passwordless auth: Enable passwordless authentication
- Key caching: Cache decrypted keys
Why it matters:
- Convenience: Avoid repeated passphrase entry
- Key management: Manage SSH keys
- Automation: Enable automated SSH
Basic usage:
# Add default keys
ssh-add
# Adds default keys (~/.ssh/id_*)Show loaded keys:
# List loaded keys
ssh-add -l
# Shows fingerprint of loaded keysAdd key:
# Add specific key
ssh-add ~/.ssh/id_ed25519
# Adds key (prompts for passphrase)Add all:
# Add all keys in ~/.ssh
ssh-add ~/.ssh/*
# Adds all keysRemove key:
# Remove key
ssh-add -d ~/.ssh/id_ed25519
# -d = delete (removes key)Remove all:
# Clear all keys
ssh-add -D
# -D = delete all (removes all keys)Start agent:
# Start agent first
eval "$(ssh-agent -s)"
# Then add keys
ssh-add ~/.ssh/id_ed25519This guide covered ssh-add usage, key management, and passwordless authentication for Arch Linux, CachyOS, and other distributions.
- ssh-keygen Guide - Generate keys
- ssh-agent Guide - Key agent
- SSH Configuration - SSH setup
-
ssh-add Documentation:
man ssh-add
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.