blob: fff0db6bc07c7a79c70d8c9300b33bae6fd6d7cc [file] [log] [blame]
naddy@openbsd.org141df482019-12-21 20:22:34 +00001.\" $OpenBSD: ssh-agent.1,v 1.70 2019/12/21 20:22:34 naddy Exp $
Damien Miller32aa1441999-10-29 09:15:49 +10002.\"
3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
Damien Miller32aa1441999-10-29 09:15:49 +10004.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5.\" All rights reserved
6.\"
Damien Millere4340be2000-09-16 13:29:08 +11007.\" As far as I am concerned, the code I have written for this software
8.\" can be used freely for any purpose. Any derived versions of this
9.\" software must be clearly marked as such, and if the derived work is
10.\" incompatible with the protocol description in the RFC file, it must be
11.\" called by a name other than "ssh" or "Secure Shell".
12.\"
Ben Lindstrom92a2e382001-03-05 06:59:27 +000013.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
14.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
15.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
Damien Millere4340be2000-09-16 13:29:08 +110016.\"
17.\" Redistribution and use in source and binary forms, with or without
18.\" modification, are permitted provided that the following conditions
19.\" are met:
20.\" 1. Redistributions of source code must retain the above copyright
21.\" notice, this list of conditions and the following disclaimer.
22.\" 2. Redistributions in binary form must reproduce the above copyright
23.\" notice, this list of conditions and the following disclaimer in the
24.\" documentation and/or other materials provided with the distribution.
25.\"
26.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
Damien Miller32aa1441999-10-29 09:15:49 +100036.\"
naddy@openbsd.org141df482019-12-21 20:22:34 +000037.Dd $Mdocdate: December 21 2019 $
Damien Miller32aa1441999-10-29 09:15:49 +100038.Dt SSH-AGENT 1
39.Os
40.Sh NAME
41.Nm ssh-agent
jmc@openbsd.org483cc722019-11-30 07:07:59 +000042.Nd OpenSSH authentication agent
Damien Miller32aa1441999-10-29 09:15:49 +100043.Sh SYNOPSIS
Damien Miller22c77262000-04-13 12:26:34 +100044.Nm ssh-agent
Damien Millerde735ea2010-09-10 11:12:38 +100045.Op Fl c | s
jmc@openbsd.org4402d6c2019-11-19 16:02:32 +000046.Op Fl \&Dd
Damien Miller5cbe7ca2007-09-17 16:05:50 +100047.Op Fl a Ar bind_address
djm@openbsd.org56d1c832014-12-21 22:27:55 +000048.Op Fl E Ar fingerprint_hash
djm@openbsd.org07da39f2019-10-31 21:22:01 +000049.Op Fl P Ar provider_whitelist
jmc@openbsd.org5d333132016-11-30 06:54:26 +000050.Op Fl t Ar life
Damien Miller5cbe7ca2007-09-17 16:05:50 +100051.Op Ar command Op Ar arg ...
jmc@openbsd.org4402d6c2019-11-19 16:02:32 +000052.Nm ssh-agent
53.Op Fl c | s
54.Fl k
Damien Miller22c77262000-04-13 12:26:34 +100055.Sh DESCRIPTION
Damien Miller32aa1441999-10-29 09:15:49 +100056.Nm
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +000057is a program to hold private keys used for public key authentication.
Damien Miller450a7a12000-03-26 13:04:51 +100058Through use of environment variables the agent can be located
Damien Millerad833b32000-08-23 10:46:23 +100059and automatically used for authentication when logging in to other
Damien Miller32aa1441999-10-29 09:15:49 +100060machines using
61.Xr ssh 1 .
62.Pp
63The options are as follows:
64.Bl -tag -width Ds
Ben Lindstromb7788f32002-06-06 21:46:08 +000065.It Fl a Ar bind_address
Darren Tuckerae69e1d2009-10-24 11:41:34 +110066Bind the agent to the
Darren Tucker98c9aec2009-10-24 11:42:44 +110067.Ux Ns -domain
68socket
Ben Lindstromb7788f32002-06-06 21:46:08 +000069.Ar bind_address .
70The default is
Damien Miller2cd62932010-12-01 11:50:35 +110071.Pa $TMPDIR/ssh-XXXXXXXXXX/agent.\*(Ltppid\*(Gt .
Damien Miller32aa1441999-10-29 09:15:49 +100072.It Fl c
73Generate C-shell commands on
74.Dv stdout .
75This is the default if
76.Ev SHELL
77looks like it's a csh style of shell.
djm@openbsd.org2ea97462015-04-24 05:26:44 +000078.It Fl D
79Foreground mode.
80When this option is specified
81.Nm
82will not fork.
Damien Miller5cbe7ca2007-09-17 16:05:50 +100083.It Fl d
84Debug mode.
85When this option is specified
86.Nm
djm@openbsd.org2ea97462015-04-24 05:26:44 +000087will not fork and will write debug information to standard error.
djm@openbsd.org56d1c832014-12-21 22:27:55 +000088.It Fl E Ar fingerprint_hash
89Specifies the hash algorithm used when displaying key fingerprints.
90Valid options are:
91.Dq md5
92and
93.Dq sha256 .
94The default is
95.Dq sha256 .
Damien Miller5cbe7ca2007-09-17 16:05:50 +100096.It Fl k
97Kill the current agent (given by the
98.Ev SSH_AGENT_PID
99environment variable).
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000100.It Fl P Ar provider_whitelist
naddy@openbsd.org141df482019-12-21 20:22:34 +0000101Specify a pattern-list of acceptable paths for PKCS#11 and FIDO authenticator
102shared libraries that may be used with the
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000103.Fl S
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +0000104or
105.Fl s
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000106options to
djm@openbsd.org786d5992016-11-30 03:07:37 +0000107.Xr ssh-add 1 .
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000108Libraries that do not match the whitelist will be refused.
djm@openbsd.org786d5992016-11-30 03:07:37 +0000109See PATTERNS in
110.Xr ssh_config 5
111for a description of pattern-list syntax.
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +0000112The default whitelist is
113.Dq /usr/lib/*,/usr/local/lib/* .
Damien Miller32aa1441999-10-29 09:15:49 +1000114.It Fl s
115Generate Bourne shell commands on
116.Dv stdout .
117This is the default if
118.Ev SHELL
119does not look like it's a csh style of shell.
Damien Miller53d81482003-01-22 11:47:19 +1100120.It Fl t Ar life
Damien Miller495dca32003-04-01 21:42:14 +1000121Set a default value for the maximum lifetime of identities added to the agent.
Damien Miller53d81482003-01-22 11:47:19 +1100122The lifetime may be specified in seconds or in a time format specified in
Darren Tucker3a4634f2005-11-28 17:05:40 +1100123.Xr sshd_config 5 .
Damien Miller53d81482003-01-22 11:47:19 +1100124A lifetime specified for an identity with
125.Xr ssh-add 1
126overrides this value.
127Without this option the default maximum lifetime is forever.
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +0000128.It Ar command Op Ar arg ...
129If a command (and optional arguments) is given,
130this is executed as a subprocess of the agent.
Damien Miller32aa1441999-10-29 09:15:49 +1000131The agent exits automatically when the command given on the command
132line terminates.
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +0000133.El
134.Pp
135There are two main ways to get an agent set up.
136The first is at the start of an X session,
137where all other windows or programs are started as children of the
138.Nm
139program.
140The agent starts a command under which its environment
141variables are exported, for example
142.Cm ssh-agent xterm & .
143When the command terminates, so does the agent.
144.Pp
145The second method is used for a login session.
146When
147.Nm
148is started,
149it prints the shell commands required to set its environment variables,
150which in turn can be evaluated in the calling shell, for example
151.Cm eval `ssh-agent -s` .
152.Pp
153In both cases,
154.Xr ssh 1
155looks at these environment variables and uses them to establish a connection to the agent.
156.Pp
157The agent initially does not have any private keys.
158Keys are added using
159.Xr ssh-add 1
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.
175.Pp
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
199.Ux Ns -domain
200socket and stores its pathname in this variable.
201It is accessible only to the current user,
202but is easily abused by root or another instance of the same user.
203.El
Damien Miller32aa1441999-10-29 09:15:49 +1000204.Sh FILES
205.Bl -tag -width Ds
jmc@openbsd.org5d333132016-11-30 06:54:26 +0000206.It Pa $TMPDIR/ssh-XXXXXXXXXX/agent.<ppid>
Darren Tucker98c9aec2009-10-24 11:42:44 +1100207.Ux Ns -domain
208sockets used to contain the connection to the authentication agent.
Damien Miller450a7a12000-03-26 13:04:51 +1000209These sockets should only be readable by the owner.
210The sockets should get automatically removed when the agent exits.
Damien Miller37023962000-07-11 17:31:38 +1000211.El
Damien Millerf1ce5052003-06-11 22:04:39 +1000212.Sh SEE ALSO
213.Xr ssh 1 ,
214.Xr ssh-add 1 ,
215.Xr ssh-keygen 1 ,
jmc@openbsd.org9a0e01b2019-11-28 12:23:25 +0000216.Xr ssh_config 5 ,
Damien Millerf1ce5052003-06-11 22:04:39 +1000217.Xr sshd 8
Damien Miller0bc1bd82000-11-13 22:57:25 +1100218.Sh AUTHORS
jmc@openbsd.org5d333132016-11-30 06:54:26 +0000219.An -nosplit
220OpenSSH is a derivative of the original and free ssh 1.2.12 release by
221.An Tatu Ylonen .
222.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos , Theo de Raadt
223and
224.An Dug Song
225removed many bugs, re-added newer features and created OpenSSH.
226.An Markus Friedl
227contributed the support for SSH protocol versions 1.5 and 2.0.