xref: /freebsd/crypto/openssh/ssh-agent.1 (revision d0c8c0bcc279fcf7568c5e97c15c115cbf83be4c)
1d0c8c0bcSDag-Erling Smørgrav.\" $OpenBSD: ssh-agent.1,v 1.37 2003/03/28 10:11:43 jmc Exp $
2511b41d2SMark Murray.\"
3511b41d2SMark Murray.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4511b41d2SMark Murray.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5511b41d2SMark Murray.\"                    All rights reserved
6511b41d2SMark Murray.\"
7b66f2d16SKris Kennaway.\" As far as I am concerned, the code I have written for this software
8b66f2d16SKris Kennaway.\" can be used freely for any purpose.  Any derived versions of this
9b66f2d16SKris Kennaway.\" software must be clearly marked as such, and if the derived work is
10b66f2d16SKris Kennaway.\" incompatible with the protocol description in the RFC file, it must be
11b66f2d16SKris Kennaway.\" called by a name other than "ssh" or "Secure Shell".
12b66f2d16SKris Kennaway.\"
13b66f2d16SKris Kennaway.\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
14b66f2d16SKris Kennaway.\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
15b66f2d16SKris Kennaway.\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
16b66f2d16SKris Kennaway.\"
17b66f2d16SKris Kennaway.\" Redistribution and use in source and binary forms, with or without
18b66f2d16SKris Kennaway.\" modification, are permitted provided that the following conditions
19b66f2d16SKris Kennaway.\" are met:
20b66f2d16SKris Kennaway.\" 1. Redistributions of source code must retain the above copyright
21b66f2d16SKris Kennaway.\"    notice, this list of conditions and the following disclaimer.
22b66f2d16SKris Kennaway.\" 2. Redistributions in binary form must reproduce the above copyright
23b66f2d16SKris Kennaway.\"    notice, this list of conditions and the following disclaimer in the
24b66f2d16SKris Kennaway.\"    documentation and/or other materials provided with the distribution.
25b66f2d16SKris Kennaway.\"
26b66f2d16SKris Kennaway.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27b66f2d16SKris Kennaway.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28b66f2d16SKris Kennaway.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29b66f2d16SKris Kennaway.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30b66f2d16SKris Kennaway.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31b66f2d16SKris Kennaway.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32b66f2d16SKris Kennaway.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33b66f2d16SKris Kennaway.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34b66f2d16SKris Kennaway.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35b66f2d16SKris Kennaway.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36511b41d2SMark Murray.\"
37511b41d2SMark Murray.Dd September 25, 1999
38511b41d2SMark Murray.Dt SSH-AGENT 1
39511b41d2SMark Murray.Os
40511b41d2SMark Murray.Sh NAME
41511b41d2SMark Murray.Nm ssh-agent
42511b41d2SMark Murray.Nd authentication agent
43511b41d2SMark Murray.Sh SYNOPSIS
44511b41d2SMark Murray.Nm ssh-agent
45545d5ecaSDag-Erling Smørgrav.Op Fl a Ar bind_address
46ae1f160dSDag-Erling Smørgrav.Op Fl c Li | Fl s
47d0c8c0bcSDag-Erling Smørgrav.Op Fl t Ar life
48ae1f160dSDag-Erling Smørgrav.Op Fl d
49ae1f160dSDag-Erling Smørgrav.Op Ar command Op Ar args ...
501e8db6e2SBrian Feldman.Nm ssh-agent
511e8db6e2SBrian Feldman.Op Fl c Li | Fl s
521e8db6e2SBrian Feldman.Fl k
53511b41d2SMark Murray.Sh DESCRIPTION
54511b41d2SMark Murray.Nm
55b66f2d16SKris Kennawayis a program to hold private keys used for public key authentication
56b66f2d16SKris Kennaway(RSA, DSA).
57a8f6863aSKris KennawayThe idea is that
58511b41d2SMark Murray.Nm
59511b41d2SMark Murrayis started in the beginning of an X-session or a login session, and
60511b41d2SMark Murrayall other windows or programs are started as clients to the ssh-agent
61a8f6863aSKris Kennawayprogram.
62a8f6863aSKris KennawayThrough use of environment variables the agent can be located
63b66f2d16SKris Kennawayand automatically used for authentication when logging in to other
64511b41d2SMark Murraymachines using
65511b41d2SMark Murray.Xr ssh 1 .
66511b41d2SMark Murray.Pp
67511b41d2SMark MurrayThe options are as follows:
68511b41d2SMark Murray.Bl -tag -width Ds
69545d5ecaSDag-Erling Smørgrav.It Fl a Ar bind_address
70545d5ecaSDag-Erling SmørgravBind the agent to the unix-domain socket
71545d5ecaSDag-Erling Smørgrav.Ar bind_address .
72545d5ecaSDag-Erling SmørgravThe default is
73ee21a45fSDag-Erling Smørgrav.Pa /tmp/ssh-XXXXXXXX/agent.<ppid> .
74511b41d2SMark Murray.It Fl c
75511b41d2SMark MurrayGenerate C-shell commands on
76511b41d2SMark Murray.Dv stdout .
77511b41d2SMark MurrayThis is the default if
78511b41d2SMark Murray.Ev SHELL
79511b41d2SMark Murraylooks like it's a csh style of shell.
80511b41d2SMark Murray.It Fl s
81511b41d2SMark MurrayGenerate Bourne shell commands on
82511b41d2SMark Murray.Dv stdout .
83511b41d2SMark MurrayThis is the default if
84511b41d2SMark Murray.Ev SHELL
85511b41d2SMark Murraydoes not look like it's a csh style of shell.
86511b41d2SMark Murray.It Fl k
87511b41d2SMark MurrayKill the current agent (given by the
88511b41d2SMark Murray.Ev SSH_AGENT_PID
89511b41d2SMark Murrayenvironment variable).
90d0c8c0bcSDag-Erling Smørgrav.It Fl t Ar life
91d0c8c0bcSDag-Erling SmørgravSet a default value for the maximum lifetime of identities added to the agent.
92d0c8c0bcSDag-Erling SmørgravThe lifetime may be specified in seconds or in a time format specified in
93d0c8c0bcSDag-Erling Smørgrav.Xr sshd 8 .
94d0c8c0bcSDag-Erling SmørgravA lifetime specified for an identity with
95d0c8c0bcSDag-Erling Smørgrav.Xr ssh-add 1
96d0c8c0bcSDag-Erling Smørgravoverrides this value.
97d0c8c0bcSDag-Erling SmørgravWithout this option the default maximum lifetime is forever.
98ae1f160dSDag-Erling Smørgrav.It Fl d
99d0c8c0bcSDag-Erling SmørgravDebug mode.
100d0c8c0bcSDag-Erling SmørgravWhen this option is specified
101ae1f160dSDag-Erling Smørgrav.Nm
102ae1f160dSDag-Erling Smørgravwill not fork.
103511b41d2SMark Murray.El
104511b41d2SMark Murray.Pp
105511b41d2SMark MurrayIf a commandline is given, this is executed as a subprocess of the agent.
106511b41d2SMark MurrayWhen the command dies, so does the agent.
107511b41d2SMark Murray.Pp
108a8f6863aSKris KennawayThe agent initially does not have any private keys.
109a8f6863aSKris KennawayKeys are added using
110511b41d2SMark Murray.Xr ssh-add 1 .
111511b41d2SMark MurrayWhen executed without arguments,
112511b41d2SMark Murray.Xr ssh-add 1
113ae1f160dSDag-Erling Smørgravadds the files
114ae1f160dSDag-Erling Smørgrav.Pa $HOME/.ssh/id_rsa ,
115ae1f160dSDag-Erling Smørgrav.Pa $HOME/.ssh/id_dsa
116ae1f160dSDag-Erling Smørgravand
117ae1f160dSDag-Erling Smørgrav.Pa $HOME/.ssh/identity .
118a8f6863aSKris KennawayIf the identity has a passphrase,
119511b41d2SMark Murray.Xr ssh-add 1
120511b41d2SMark Murrayasks for the passphrase (using a small X11 application if running
121a8f6863aSKris Kennawayunder X11, or from the terminal if running without X).
122a8f6863aSKris KennawayIt then sends the identity to the agent.
123a8f6863aSKris KennawaySeveral identities can be stored in the
124511b41d2SMark Murrayagent; the agent can automatically use any of these identities.
125511b41d2SMark Murray.Ic ssh-add -l
126511b41d2SMark Murraydisplays the identities currently held by the agent.
127511b41d2SMark Murray.Pp
128511b41d2SMark MurrayThe idea is that the agent is run in the user's local PC, laptop, or
129a8f6863aSKris Kennawayterminal.
130a8f6863aSKris KennawayAuthentication data need not be stored on any other
131511b41d2SMark Murraymachine, and authentication passphrases never go over the network.
132511b41d2SMark MurrayHowever, the connection to the agent is forwarded over SSH
133511b41d2SMark Murrayremote logins, and the user can thus use the privileges given by the
134511b41d2SMark Murrayidentities anywhere in the network in a secure way.
135511b41d2SMark Murray.Pp
136a8f6863aSKris KennawayThere are two main ways to get an agent setup:
137ae1f160dSDag-Erling SmørgravEither the agent starts a new subcommand into which some environment
138ae1f160dSDag-Erling Smørgravvariables are exported, or the agent prints the needed shell commands
139ae1f160dSDag-Erling Smørgrav(either
140511b41d2SMark Murray.Xr sh 1
141511b41d2SMark Murrayor
142511b41d2SMark Murray.Xr csh 1
143511b41d2SMark Murraysyntax can be generated) which can be evalled in the calling shell.
144511b41d2SMark MurrayLater
145511b41d2SMark Murray.Xr ssh 1
1461e8db6e2SBrian Feldmanlooks at these variables and uses them to establish a connection to the agent.
147511b41d2SMark Murray.Pp
148ae1f160dSDag-Erling SmørgravThe agent will never send a private key over its request channel.
149ae1f160dSDag-Erling SmørgravInstead, operations that require a private key will be performed
150ae1f160dSDag-Erling Smørgravby the agent, and the result will be returned to the requester.
151ae1f160dSDag-Erling SmørgravThis way, private keys are not exposed to clients using the agent.
152ae1f160dSDag-Erling Smørgrav.Pp
153511b41d2SMark MurrayA unix-domain socket is created
154511b41d2SMark Murrayand the name of this socket is stored in the
155511b41d2SMark Murray.Ev SSH_AUTH_SOCK
156511b41d2SMark Murrayenvironment
157a8f6863aSKris Kennawayvariable.
158a8f6863aSKris KennawayThe socket is made accessible only to the current user.
159511b41d2SMark MurrayThis method is easily abused by root or another instance of the same
160511b41d2SMark Murrayuser.
161511b41d2SMark Murray.Pp
162511b41d2SMark MurrayThe
163511b41d2SMark Murray.Ev SSH_AGENT_PID
164ee21a45fSDag-Erling Smørgravenvironment variable holds the agent's process ID.
165511b41d2SMark Murray.Pp
166511b41d2SMark MurrayThe agent exits automatically when the command given on the command
167511b41d2SMark Murrayline terminates.
168511b41d2SMark Murray.Sh FILES
169511b41d2SMark Murray.Bl -tag -width Ds
170511b41d2SMark Murray.It Pa $HOME/.ssh/identity
1711e8db6e2SBrian FeldmanContains the protocol version 1 RSA authentication identity of the user.
172b66f2d16SKris Kennaway.It Pa $HOME/.ssh/id_dsa
1731e8db6e2SBrian FeldmanContains the protocol version 2 DSA authentication identity of the user.
1741e8db6e2SBrian Feldman.It Pa $HOME/.ssh/id_rsa
1751e8db6e2SBrian FeldmanContains the protocol version 2 RSA authentication identity of the user.
176ee21a45fSDag-Erling Smørgrav.It Pa /tmp/ssh-XXXXXXXX/agent.<ppid>
177511b41d2SMark MurrayUnix-domain sockets used to contain the connection to the
178a8f6863aSKris Kennawayauthentication agent.
179a8f6863aSKris KennawayThese sockets should only be readable by the owner.
180a8f6863aSKris KennawayThe sockets should get automatically removed when the agent exits.
181b66f2d16SKris Kennaway.El
1821e8db6e2SBrian Feldman.Sh AUTHORS
1831e8db6e2SBrian FeldmanOpenSSH is a derivative of the original and free
1841e8db6e2SBrian Feldmanssh 1.2.12 release by Tatu Ylonen.
1851e8db6e2SBrian FeldmanAaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1861e8db6e2SBrian FeldmanTheo de Raadt and Dug Song
1871e8db6e2SBrian Feldmanremoved many bugs, re-added newer features and
1881e8db6e2SBrian Feldmancreated OpenSSH.
1891e8db6e2SBrian FeldmanMarkus Friedl contributed the support for SSH
1901e8db6e2SBrian Feldmanprotocol versions 1.5 and 2.0.
191511b41d2SMark Murray.Sh SEE ALSO
192511b41d2SMark Murray.Xr ssh 1 ,
193511b41d2SMark Murray.Xr ssh-add 1 ,
194511b41d2SMark Murray.Xr ssh-keygen 1 ,
1951e8db6e2SBrian Feldman.Xr sshd 8
196