1SSH-AGENT(1)              BSD General Commands Manual             SSH-AGENT(1)
2

NAME

4     ssh-agent — OpenSSH authentication agent
5

SYNOPSIS

7     ssh-agent [-c | -s] [-Dd] [-a bind_address] [-E fingerprint_hash]
8               [-P provider_whitelist] [-t life] [command [arg ...]]
9     ssh-agent [-c | -s] -k
10

DESCRIPTION

12     ssh-agent is a program to hold private keys used for public key authenti‐
13     cation.  Through use of environment variables the agent can be located
14     and automatically used for authentication when logging in to other
15     machines using ssh(1).
16
17     The options are as follows:
18
19     -a bind_address
20             Bind the agent to the UNIX-domain socket bind_address.  The
21             default is $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>.
22
23     -c      Generate C-shell commands on stdout.  This is the default if
24             SHELL looks like it's a csh style of shell.
25
26     -D      Foreground mode.  When this option is specified ssh-agent will
27             not fork.
28
29     -d      Debug mode.  When this option is specified ssh-agent will not
30             fork and will write debug information to standard error.
31
32     -E fingerprint_hash
33             Specifies the hash algorithm used when displaying key finger‐
34             prints.  Valid options are: “md5” and “sha256”.  The default is
35             “sha256”.
36
37     -k      Kill the current agent (given by the SSH_AGENT_PID environment
38             variable).
39
40     -P provider_whitelist
41             Specify a pattern-list of acceptable paths for PKCS#11 and FIDO
42             authenticator shared libraries that may be used with the -S or -s
43             options to ssh-add(1).  Libraries that do not match the whitelist
44             will be refused.  See PATTERNS in ssh_config(5) for a description
45             of pattern-list syntax.  The default whitelist is
46             “/usr/lib/*,/usr/local/lib/*”.
47
48     -s      Generate Bourne shell commands on stdout.  This is the default if
49             SHELL does not look like it's a csh style of shell.
50
51     -t life
52             Set a default value for the maximum lifetime of identities added
53             to the agent.  The lifetime may be specified in seconds or in a
54             time format specified in sshd_config(5).  A lifetime specified
55             for an identity with ssh-add(1) overrides this value.  Without
56             this option the default maximum lifetime is forever.
57
58     command [arg ...]
59             If a command (and optional arguments) is given, this is executed
60             as a subprocess of the agent.  The agent exits automatically when
61             the command given on the command line terminates.
62
63     There are two main ways to get an agent set up.  The first is at the
64     start of an X session, where all other windows or programs are started as
65     children of the ssh-agent program.  The agent starts a command under
66     which its environment variables are exported, for example ssh-agent xterm
67     &.  When the command terminates, so does the agent.
68
69     The second method is used for a login session.  When ssh-agent is
70     started, it prints the shell commands required to set its environment
71     variables, which in turn can be evaluated in the calling shell, for exam‐
72     ple eval `ssh-agent -s`.
73
74     In both cases, ssh(1) looks at these environment variables and uses them
75     to establish a connection to the agent.
76
77     The agent initially does not have any private keys.  Keys are added using
78     ssh-add(1) or by ssh(1) when AddKeysToAgent is set in ssh_config(5).
79     Multiple identities may be stored in ssh-agent concurrently and ssh(1)
80     will automatically use them if present.  ssh-add(1) is also used to
81     remove keys from ssh-agent and to query the keys that are held in one.
82
83     Connections to ssh-agent may be forwarded from further remote hosts using
84     the -A option to ssh(1) (but see the caveats documented therein), avoid‐
85     ing the need for authentication data to be stored on other machines.
86     Authentication passphrases and private keys never go over the network:
87     the connection to the agent is forwarded over SSH remote connections and
88     the result is returned to the requester, allowing the user access to
89     their identities anywhere in the network in a secure fashion.
90

ENVIRONMENT

92     SSH_AGENT_PID  When ssh-agent starts, it stores the name of the agent's
93                    process ID (PID) in this variable.
94
95     SSH_AUTH_SOCK  When ssh-agent starts, it creates a UNIX-domain socket and
96                    stores its pathname in this variable.  It is accessible
97                    only to the current user, but is easily abused by root or
98                    another instance of the same user.
99

FILES

101     $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>
102             UNIX-domain sockets used to contain the connection to the authen‐
103             tication agent.  These sockets should only be readable by the
104             owner.  The sockets should get automatically removed when the
105             agent exits.
106

SEE ALSO

108     ssh(1), ssh-add(1), ssh-keygen(1), ssh_config(5), sshd(8)
109

AUTHORS

111     OpenSSH is a derivative of the original and free ssh 1.2.12 release by
112     Tatu Ylonen.  Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
113     de Raadt and Dug Song removed many bugs, re-added newer features and cre‐
114     ated OpenSSH.  Markus Friedl contributed the support for SSH protocol
115     versions 1.5 and 2.0.
116
117BSD                              May 10, 2020                              BSD
Impressum