Linux Commands Helper
💬 Your AI-powered Linux assistant
ssh-agent Command - SSH Key Authentication Agent
The ssh-agent command is a program to hold private keys used for public key authentication (SSH). It runs in the background and manages your keys, so you don't have to enter your passphrase every time you use SSH.
Syntax
ssh-agent [options] [command [args...]]
Examples
eval $(ssh-agent)
Start the ssh-agent and set environment variables in the current shell.
ssh-add ~/.ssh/id_rsa
Add a private key to the agent (run after starting ssh-agent).
ssh-agent bash
Start a new bash shell with ssh-agent running.
Notes
- ssh-agent is often used with
ssh-add
to manage multiple keys. - It improves security by keeping private keys in memory, not on disk.
- Remember to kill the agent after use with
eval $(ssh-agent -k)
.