Jump to content

ssh-agent

From RaySoft

ssh-agent is a program to hold private keys used for public key authentication. Through use of environment variables the agent can be located and automatically used for authentication when logging in to other machines using ssh.[1]

Documentation

Syntax

ssh-agent [PARAMETER ...]

Parameters

-k
Kill the current agent.
-s
Generate Bourne shell commands on standard output. This is the default if SHELL does not look like it's a csh style of shell.

Examples

Provide git with a SSH private key
eval "$(ssh-agent -s)"

ssh-add -q "${HOME}/.ssh/id_ed25519_alex@codeberg"

git push --set-upstream 'origin' 'main'

References

  1. Project contributors. "ssh-agent(1)." OpenSSH project. https://man.openbsd.org/ssh-agent (accessed 18.03.2025)