]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - crypto/openssh/ssh-add.1
MFH (r237568, r255422, r255460, r255766, r255767, r255774, r255829,
[FreeBSD/stable/9.git] / crypto / openssh / ssh-add.1
1 .\"     $OpenBSD: ssh-add.1,v 1.59 2013/12/07 11:58:46 naddy Exp $
2 .\"     $FreeBSD$
3 .\"
4 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
5 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 .\"                    All rights reserved
7 .\"
8 .\" As far as I am concerned, the code I have written for this software
9 .\" can be used freely for any purpose.  Any derived versions of this
10 .\" software must be clearly marked as such, and if the derived work is
11 .\" incompatible with the protocol description in the RFC file, it must be
12 .\" called by a name other than "ssh" or "Secure Shell".
13 .\"
14 .\"
15 .\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
16 .\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
17 .\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
18 .\"
19 .\" Redistribution and use in source and binary forms, with or without
20 .\" modification, are permitted provided that the following conditions
21 .\" are met:
22 .\" 1. Redistributions of source code must retain the above copyright
23 .\"    notice, this list of conditions and the following disclaimer.
24 .\" 2. Redistributions in binary form must reproduce the above copyright
25 .\"    notice, this list of conditions and the following disclaimer in the
26 .\"    documentation and/or other materials provided with the distribution.
27 .\"
28 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
29 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
30 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
32 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
33 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
37 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 .\"
39 .Dd December 7, 2013
40 .Dt SSH-ADD 1
41 .Os
42 .Sh NAME
43 .Nm ssh-add
44 .Nd adds private key identities to the authentication agent
45 .Sh SYNOPSIS
46 .Nm ssh-add
47 .Op Fl cDdkLlXx
48 .Op Fl t Ar life
49 .Op Ar
50 .Nm ssh-add
51 .Fl s Ar pkcs11
52 .Nm ssh-add
53 .Fl e Ar pkcs11
54 .Sh DESCRIPTION
55 .Nm
56 adds private key identities to the authentication agent,
57 .Xr ssh-agent 1 .
58 When run without arguments, it adds the files
59 .Pa ~/.ssh/id_rsa ,
60 .Pa ~/.ssh/id_dsa ,
61 .Pa ~/.ssh/id_ecdsa ,
62 .Pa ~/.ssh/id_ed25519
63 and
64 .Pa ~/.ssh/identity .
65 After loading a private key,
66 .Nm
67 will try to load corresponding certificate information from the
68 filename obtained by appending
69 .Pa -cert.pub
70 to the name of the private key file.
71 Alternative file names can be given on the command line.
72 .Pp
73 If any file requires a passphrase,
74 .Nm
75 asks for the passphrase from the user.
76 The passphrase is read from the user's tty.
77 .Nm
78 retries the last passphrase if multiple identity files are given.
79 .Pp
80 The authentication agent must be running and the
81 .Ev SSH_AUTH_SOCK
82 environment variable must contain the name of its socket for
83 .Nm
84 to work.
85 .Pp
86 The options are as follows:
87 .Bl -tag -width Ds
88 .It Fl c
89 Indicates that added identities should be subject to confirmation before
90 being used for authentication.
91 Confirmation is performed by the
92 .Ev SSH_ASKPASS
93 program mentioned below.
94 Successful confirmation is signaled by a zero exit status from the
95 .Ev SSH_ASKPASS
96 program, rather than text entered into the requester.
97 .It Fl D
98 Deletes all identities from the agent.
99 .It Fl d
100 Instead of adding identities, removes identities from the agent.
101 If
102 .Nm
103 has been run without arguments, the keys for the default identities and
104 their corresponding certificates will be removed.
105 Otherwise, the argument list will be interpreted as a list of paths to
106 public key files to specify keys and certificates to be removed from the agent.
107 If no public key is found at a given path,
108 .Nm
109 will append
110 .Pa .pub
111 and retry.
112 .It Fl e Ar pkcs11
113 Remove keys provided by the PKCS#11 shared library
114 .Ar pkcs11 .
115 .It Fl k
116 When loading keys into or deleting keys from the agent, process plain private
117 keys only and skip certificates.
118 .It Fl L
119 Lists public key parameters of all identities currently represented
120 by the agent.
121 .It Fl l
122 Lists fingerprints of all identities currently represented by the agent.
123 .It Fl s Ar pkcs11
124 Add keys provided by the PKCS#11 shared library
125 .Ar pkcs11 .
126 .It Fl t Ar life
127 Set a maximum lifetime when adding identities to an agent.
128 The lifetime may be specified in seconds or in a time format
129 specified in
130 .Xr sshd_config 5 .
131 .It Fl X
132 Unlock the agent.
133 .It Fl x
134 Lock the agent with a password.
135 .El
136 .Sh ENVIRONMENT
137 .Bl -tag -width Ds
138 .It Ev "DISPLAY" and "SSH_ASKPASS"
139 If
140 .Nm
141 needs a passphrase, it will read the passphrase from the current
142 terminal if it was run from a terminal.
143 If
144 .Nm
145 does not have a terminal associated with it but
146 .Ev DISPLAY
147 and
148 .Ev SSH_ASKPASS
149 are set, it will execute the program specified by
150 .Ev SSH_ASKPASS
151 and open an X11 window to read the passphrase.
152 This is particularly useful when calling
153 .Nm
154 from a
155 .Pa .xsession
156 or related script.
157 (Note that on some machines it
158 may be necessary to redirect the input from
159 .Pa /dev/null
160 to make this work.)
161 .It Ev SSH_AUTH_SOCK
162 Identifies the path of a
163 .Ux Ns -domain
164 socket used to communicate with the agent.
165 .El
166 .Sh FILES
167 .Bl -tag -width Ds
168 .It Pa ~/.ssh/identity
169 Contains the protocol version 1 RSA authentication identity of the user.
170 .It Pa ~/.ssh/id_dsa
171 Contains the protocol version 2 DSA authentication identity of the user.
172 .It Pa ~/.ssh/id_ecdsa
173 Contains the protocol version 2 ECDSA authentication identity of the user.
174 .It Pa ~/.ssh/id_ed25519
175 Contains the protocol version 2 ED25519 authentication identity of the user.
176 .It Pa ~/.ssh/id_rsa
177 Contains the protocol version 2 RSA authentication identity of the user.
178 .El
179 .Pp
180 Identity files should not be readable by anyone but the user.
181 Note that
182 .Nm
183 ignores identity files if they are accessible by others.
184 .Sh EXIT STATUS
185 Exit status is 0 on success, 1 if the specified command fails,
186 and 2 if
187 .Nm
188 is unable to contact the authentication agent.
189 .Sh SEE ALSO
190 .Xr ssh 1 ,
191 .Xr ssh-agent 1 ,
192 .Xr ssh-keygen 1 ,
193 .Xr sshd 8
194 .Sh AUTHORS
195 OpenSSH is a derivative of the original and free
196 ssh 1.2.12 release by Tatu Ylonen.
197 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
198 Theo de Raadt and Dug Song
199 removed many bugs, re-added newer features and
200 created OpenSSH.
201 Markus Friedl contributed the support for SSH
202 protocol versions 1.5 and 2.0.