keychain
manages SSH and GPG agent processes
TLDR
SYNOPSIS
keychain [options] [keys...]
DESCRIPTION
keychain is a front-end to ssh-agent and gpg-agent that manages long-running agent processes across login sessions. Rather than starting a new agent each time a shell is opened, keychain checks for an existing agent, reuses it if found, and only starts a new one when necessary, storing the agent's environment variables in files under `~/.keychain` so any shell can inherit them.This approach means you only need to enter your passphrase once after a reboot, and all subsequent terminal sessions, cron jobs, and scripts can use the cached keys without further prompting. The tool supports managing both SSH and GPG keys simultaneously via the `--agents` flag and outputs shell-evaluable commands that set the appropriate `SSHAUTHSOCK` and `GPGAGENTINFO` environment variables.
PARAMETERS
KEYS
SSH or GPG keys to manage.--eval
Output shell eval commands.--agents LIST
Agent types (ssh, gpg).--clear
Clear cached keys.-q, --quiet
Suppress output.-l, --list
List cached keys.--noask
Set up agent files but do not prompt to add keys if not already loaded.--stop which
Kill agent processes. Values: mine (keychain's agents), others, or all.--timeout MINUTES
Set a timeout in minutes for identities added to ssh-agent.--nogui
Disable SSH_ASKPASS, forcing ssh-add to prompt on the terminal.--ignore-missing
Suppress warnings if specified keys cannot be found.--help
Display help information.
CAVEATS
Requires shell integration by adding an `eval $(keychain --eval ...)` line to your shell profile (e.g., `.bash_profile` or `.zshrc`). Agent environment variables are stored in `~/.keychain/`.
HISTORY
keychain was created by Daniel Robbins (Funtoo) to simplify SSH agent management across sessions.
