SSH - ssh-agent

About

ssh-agent is the authentication agent of the Openssh ssh cli .

It stores un/desencrypted private keys in memory, and communicates with SSH clients via Unix_domain_socket

Management

Start

  • Start the ssh-agent in the background.
eval `ssh-agent`
# or ssh-agent bash
# or eval "$(ssh-agent -s)"

Status

Test if SSH agent is running (If nothing is returned, then ssh-agent is not running)

echo "$SSH_AUTH_SOCK"
/tmp/ssh-rfSUL1ldCldQ/agent.1792

Add a key

  • Add SSH private key to the ssh-agent
ssh-add ~/.ssh/id_rsa

List the keys

ssh-add -l

Documentation / Reference


Powered by ComboStrap