summaryrefslogtreecommitdiff
path: root/ssh-agent.1
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-agent.1')
-rw-r--r--ssh-agent.1170
1 files changed, 83 insertions, 87 deletions
diff --git a/ssh-agent.1 b/ssh-agent.1
index 83b2b41c8..fff0db6bc 100644
--- a/ssh-agent.1
+++ b/ssh-agent.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-agent.1,v 1.64 2016/11/30 06:54:26 jmc Exp $ 1.\" $OpenBSD: ssh-agent.1,v 1.70 2019/12/21 20:22:34 naddy Exp $
2.\" 2.\"
3.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -34,19 +34,19 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.Dd $Mdocdate: November 30 2016 $ 37.Dd $Mdocdate: December 21 2019 $
38.Dt SSH-AGENT 1 38.Dt SSH-AGENT 1
39.Os 39.Os
40.Sh NAME 40.Sh NAME
41.Nm ssh-agent 41.Nm ssh-agent
42.Nd authentication agent 42.Nd OpenSSH authentication agent
43.Sh SYNOPSIS 43.Sh SYNOPSIS
44.Nm ssh-agent 44.Nm ssh-agent
45.Op Fl c | s 45.Op Fl c | s
46.Op Fl \&Dd 46.Op Fl \&Dd
47.Op Fl a Ar bind_address 47.Op Fl a Ar bind_address
48.Op Fl E Ar fingerprint_hash 48.Op Fl E Ar fingerprint_hash
49.Op Fl P Ar pkcs11_whitelist 49.Op Fl P Ar provider_whitelist
50.Op Fl t Ar life 50.Op Fl t Ar life
51.Op Ar command Op Ar arg ... 51.Op Ar command Op Ar arg ...
52.Nm ssh-agent 52.Nm ssh-agent
@@ -54,37 +54,12 @@
54.Fl k 54.Fl k
55.Sh DESCRIPTION 55.Sh DESCRIPTION
56.Nm 56.Nm
57is a program to hold private keys used for public key authentication 57is a program to hold private keys used for public key authentication.
58(RSA, DSA, ECDSA, Ed25519).
59.Nm
60is usually started in the beginning of an X-session or a login session, and
61all other windows or programs are started as clients to the ssh-agent
62program.
63Through use of environment variables the agent can be located 58Through use of environment variables the agent can be located
64and automatically used for authentication when logging in to other 59and automatically used for authentication when logging in to other
65machines using 60machines using
66.Xr ssh 1 . 61.Xr ssh 1 .
67.Pp 62.Pp
68The agent initially does not have any private keys.
69Keys are added using
70.Xr ssh 1
71(see
72.Cm AddKeysToAgent
73in
74.Xr ssh_config 5
75for details)
76or
77.Xr ssh-add 1 .
78Multiple identities may be stored in
79.Nm
80concurrently and
81.Xr ssh 1
82will automatically use them if present.
83.Xr ssh-add 1
84is also used to remove keys from
85.Nm
86and to query the keys that are held in one.
87.Pp
88The options are as follows: 63The options are as follows:
89.Bl -tag -width Ds 64.Bl -tag -width Ds
90.It Fl a Ar bind_address 65.It Fl a Ar bind_address
@@ -122,18 +97,20 @@ The default is
122Kill the current agent (given by the 97Kill the current agent (given by the
123.Ev SSH_AGENT_PID 98.Ev SSH_AGENT_PID
124environment variable). 99environment variable).
125.It Fl P Ar pkcs11_whitelist 100.It Fl P Ar provider_whitelist
126Specify a pattern-list of acceptable paths for PKCS#11 shared libraries 101Specify a pattern-list of acceptable paths for PKCS#11 and FIDO authenticator
127that may be added using the 102shared libraries that may be used with the
103.Fl S
104or
128.Fl s 105.Fl s
129option to 106options to
130.Xr ssh-add 1 . 107.Xr ssh-add 1 .
131The default is to allow loading PKCS#11 libraries from 108Libraries that do not match the whitelist will be refused.
132.Dq /usr/lib/*,/usr/local/lib/* .
133PKCS#11 libraries that do not match the whitelist will be refused.
134See PATTERNS in 109See PATTERNS in
135.Xr ssh_config 5 110.Xr ssh_config 5
136for a description of pattern-list syntax. 111for a description of pattern-list syntax.
112The default whitelist is
113.Dq /usr/lib/*,/usr/local/lib/* .
137.It Fl s 114.It Fl s
138Generate Bourne shell commands on 115Generate Bourne shell commands on
139.Dv stdout . 116.Dv stdout .
@@ -148,64 +125,82 @@ A lifetime specified for an identity with
148.Xr ssh-add 1 125.Xr ssh-add 1
149overrides this value. 126overrides this value.
150Without this option the default maximum lifetime is forever. 127Without this option the default maximum lifetime is forever.
128.It Ar command Op Ar arg ...
129If a command (and optional arguments) is given,
130this is executed as a subprocess of the agent.
131The agent exits automatically when the command given on the command
132line terminates.
151.El 133.El
152.Pp 134.Pp
153If a command line is given, this is executed as a subprocess of the agent. 135There are two main ways to get an agent set up.
154When the command dies, so does the agent. 136The first is at the start of an X session,
155.Pp 137where all other windows or programs are started as children of the
156The idea is that the agent is run in the user's local PC, laptop, or 138.Nm
157terminal. 139program.
158Authentication data need not be stored on any other 140The agent starts a command under which its environment
159machine, and authentication passphrases never go over the network. 141variables are exported, for example
160However, the connection to the agent is forwarded over SSH
161remote logins, and the user can thus use the privileges given by the
162identities anywhere in the network in a secure way.
163.Pp
164There are two main ways to get an agent set up:
165The first is that the agent starts a new subcommand into which some environment
166variables are exported, eg
167.Cm ssh-agent xterm & . 142.Cm ssh-agent xterm & .
168The second is that the agent prints the needed shell commands (either 143When the command terminates, so does the agent.
169.Xr sh 1 144.Pp
170or 145The second method is used for a login session.
171.Xr csh 1 146When
172syntax can be generated) which can be evaluated in the calling shell, eg 147.Nm
173.Cm eval `ssh-agent -s` 148is started,
174for Bourne-type shells such as 149it prints the shell commands required to set its environment variables,
175.Xr sh 1 150which in turn can be evaluated in the calling shell, for example
176or 151.Cm eval `ssh-agent -s` .
177.Xr ksh 1
178and
179.Cm eval `ssh-agent -c`
180for
181.Xr csh 1
182and derivatives.
183.Pp 152.Pp
184Later 153In both cases,
185.Xr ssh 1 154.Xr ssh 1
186looks at these variables and uses them to establish a connection to the agent. 155looks at these environment variables and uses them to establish a connection to the agent.
187.Pp 156.Pp
188The agent will never send a private key over its request channel. 157The agent initially does not have any private keys.
189Instead, operations that require a private key will be performed 158Keys are added using
190by the agent, and the result will be returned to the requester. 159.Xr ssh-add 1
191This way, private keys are not exposed to clients using the agent. 160or by
161.Xr ssh 1
162when
163.Cm AddKeysToAgent
164is set in
165.Xr ssh_config 5 .
166Multiple identities may be stored in
167.Nm
168concurrently and
169.Xr ssh 1
170will automatically use them if present.
171.Xr ssh-add 1
172is also used to remove keys from
173.Nm
174and to query the keys that are held in one.
192.Pp 175.Pp
193A 176Connections to
177.Nm
178may be forwarded from further remote hosts using the
179.Fl A
180option to
181.Xr ssh 1
182(but see the caveats documented therein),
183avoiding the need for authentication data to be stored on other machines.
184Authentication passphrases and private keys never go over the network:
185the connection to the agent is forwarded over SSH remote connections
186and the result is returned to the requester,
187allowing the user access to their identities anywhere in the network
188in a secure fashion.
189.Sh ENVIRONMENT
190.Bl -tag -width "SSH_AGENT_PID"
191.It Ev SSH_AGENT_PID
192When
193.Nm
194starts, it stores the name of the agent's process ID (PID) in this variable.
195.It Ev SSH_AUTH_SOCK
196When
197.Nm
198starts, it creates a
194.Ux Ns -domain 199.Ux Ns -domain
195socket is created and the name of this socket is stored in the 200socket and stores its pathname in this variable.
196.Ev SSH_AUTH_SOCK 201It is accessible only to the current user,
197environment 202but is easily abused by root or another instance of the same user.
198variable. 203.El
199The socket is made accessible only to the current user.
200This method is easily abused by root or another instance of the same
201user.
202.Pp
203The
204.Ev SSH_AGENT_PID
205environment variable holds the agent's process ID.
206.Pp
207The agent exits automatically when the command given on the command
208line terminates.
209.Sh FILES 204.Sh FILES
210.Bl -tag -width Ds 205.Bl -tag -width Ds
211.It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid> 206.It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>
@@ -218,6 +213,7 @@ The sockets should get automatically removed when the agent exits.
218.Xr ssh 1 , 213.Xr ssh 1 ,
219.Xr ssh-add 1 , 214.Xr ssh-add 1 ,
220.Xr ssh-keygen 1 , 215.Xr ssh-keygen 1 ,
216.Xr ssh_config 5 ,
221.Xr sshd 8 217.Xr sshd 8
222.Sh AUTHORS 218.Sh AUTHORS
223.An -nosplit 219.An -nosplit