summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/ssh-add.1
blob: fc7ec94c4a64e0644e768f7c4f279b7b7d0742e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
'\" te
.\" To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the
.\" installed location.
.\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.TH SSH-ADD 1 "May 20, 2009"
.SH NAME
ssh-add \- add RSA or DSA identities to the authentication agent
.SH SYNOPSIS
.LP
.nf
\fBssh-add\fR [\fB-lLdDxX\fR] [\fB-t\fR \fIlife\fR] [ \fIfile\fR ]...
.fi

.SH DESCRIPTION
.sp
.LP
The \fBssh-add\fR utility adds \fBRSA\fR or \fBDSA\fR identities to the
authentication agent, \fBssh-agent\fR(1). When run without arguments, it
attempts to add all of the files \fB$HOME/.ssh/identity\fR (RSA v1),
\fB$HOME/.ssh/id_rsa\fR (RSA v2), and \fB$HOME/.ssh/id_dsa\fR (DSA v2) that
exist. If more than one of the private keys exists, an attempt to decrypt each
with the same passphrase is made before reprompting for a different passphrase.
The passphrase is read from the user's tty or by running the program defined in
\fBSSH_ASKPASS\fR (see below).
.sp
.LP
The authentication agent must be running.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 11n
Instead of adding the identity, this option \fBremoves\fR the identity from the
agent.
.RE

.sp
.ne 2
.na
\fB\fB-D\fR\fR
.ad
.RS 11n
Deletes all identities from the agent.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 11n
Lists fingerprints of all identities currently represented by the agent.
.RE

.sp
.ne 2
.na
\fB\fB-L\fR\fR
.ad
.RS 11n
Lists public key parameters of all identities currently represented by the
agent.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR \fIlife\fR\fR
.ad
.RS 11n
Sets a maximum lifetime when adding identities to an agent. The lifetime can be
specified in seconds or in a time format specified in \fBsshd\fR(1M).
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 11n
Locks the agent with a password.
.RE

.sp
.ne 2
.na
\fB\fB-X\fR\fR
.ad
.RS 11n
Unlocks the agent.
.RE

.SH ENVIRONMENT VARIABLES
.sp
.ne 2
.na
\fB\fBDISPLAY\fR\fR
.ad
.br
.na
\fB\fBSSH_ASKPASS\fR\fR
.ad
.RS 17n
If \fBssh-add\fR needs a passphrase, it reads the passphrase from the current
terminal if it was run from a terminal. If \fBssh-add\fR does not have a
terminal associated with it but \fBDISPLAY\fR and \fBSSH_ASKPASS\fR are set, it
executes the program specified by \fBSSH_ASKPASS\fR and open an X11 window to
read the passphrase. This is particularly useful when calling \fBssh-add\fR
from a .Xsession or related script. The system is shipped with
\fB/usr/lib/ssh/ssh-askpass\fR which is the default value for
\fBSSH_ASKPASS\fR.
.RE

.sp
.ne 2
.na
\fB\fBSSH_AUTH_SOCK\fR\fR
.ad
.RS 17n
Identifies the path of a unix-domain socket used to communicate with the agent.
.RE

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
An error occurred.
.RE

.SH FILES
.sp
.LP
These files should not be readable by anyone but the user. Notice that
\fBssh-add\fR ignores a file if it is accessible by others. It is possible to
specify a passphrase when generating the key; that passphrase is used to
encrypt the private part of this file.
.sp
.LP
If these files are stored on a network file system it is assumed that either
the protection provided in the file themselves or the transport layer of the
network file system provides sufficient protection for the site policy. If this
is not the case, then it is recommended the key files are stored on removable
media or locally on the relevant hosts.
.sp
.LP
Recommended names for the \fBDSA\fR and \fBRSA\fR key files:
.sp
.ne 2
.na
\fB\fB$HOME/.ssh/identity\fR\fR
.ad
.RS 28n
Contains the \fBRSA\fR authentication identity of the user for protocol version
1.
.RE

.sp
.ne 2
.na
\fB\fB$HOME/.ssh/identity.pub\fR\fR
.ad
.RS 28n
Contains the public part of the \fBRSA\fR authentication identity of the user
for protocol version 1.
.RE

.sp
.ne 2
.na
\fB\fB$HOME/.ssh/id_dsa\fR\fR
.ad
.RS 28n
Contains the private \fBDSA\fR authentication identity of the user.
.RE

.sp
.ne 2
.na
\fB\fB$HOME/.ssh/id_dsa.pub\fR\fR
.ad
.RS 28n
Contains the public part of the DSA authentication identity of the user.
.RE

.sp
.ne 2
.na
\fB\fB$HOME/.ssh/id_rsa\fR\fR
.ad
.RS 28n
Contains the private \fBRSA\fR authentication identity of the user.
.RE

.sp
.ne 2
.na
\fB\fB$HOME/.ssh/id_rsa.pub\fR\fR
.ad
.RS 28n
Contains the public part of the \fBRSA\fR authentication identity of the user.
.RE

.sp
.ne 2
.na
\fB\fB/usr/lib/ssh/ssh-askpass\fR\fR
.ad
.RS 28n
Contains the default value for SSH_ASKPASS.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.sp
.LP
\fBssh\fR(1), \fBssh-agent\fR(1), \fBssh-keygen\fR(1), \fBsshd\fR(1M),
\fBattributes\fR(5)