]> git.sur5r.net Git - openldap/blob - doc/man/man8/slappasswd.8
92b12da16d78dad188b06f8a58636e581ef705cd
[openldap] / doc / man / man8 / slappasswd.8
1 .TH SLAPPASSWD 8C "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2017 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slappasswd \- OpenLDAP password utility
7 .SH SYNOPSIS
8 .B SBINDIR/slappasswd
9 [\c
10 .BR \-v ]
11 [\c
12 .BR \-u ]
13 [\c
14 .BR \-g \||\| \-s \ \fIsecret\fR \||\| \fB\-T \ \fIfile\fR]
15 [\c
16 .BI \-h \ hash\fR]
17 [\c
18 .BI \-c \ salt-format\fR]
19 [\c
20 .BR \-n ]
21 [\c
22 .BI \-o \ option\fR[ = value\fR]]
23 .LP
24 .SH DESCRIPTION
25 .LP
26 .B Slappasswd
27 is used to generate an userPassword value
28 suitable for use with
29 .BR ldapmodify (1),
30 .BR slapd.conf (5)
31 .I rootpw
32 configuration directive or the 
33 .BR slapd\-config (5) 
34 .I olcRootPW
35 configuration directive.
36 .
37 .SH OPTIONS
38 .TP
39 .B \-v
40 enable verbose mode.
41 .TP
42 .B \-u
43 Generate RFC 2307 userPassword values (the default).  Future
44 versions of this program may generate alternative syntaxes
45 by default.  This option is provided for forward compatibility.
46 .TP
47 .BI \-s \ secret
48 The secret to hash.
49 If this,
50 .B \-g
51 and
52 .B \-T
53 are absent, the user will be prompted for the secret to hash.
54 .BR \-s ,
55 .B \-g
56 and
57 .B \-T
58 are mutually exclusive flags.
59 .TP
60 .BI \-g
61 Generate the secret.
62 If this,
63 .B \-s
64 and
65 .B \-T
66 are absent, the user will be prompted for the secret to hash.
67 .BR \-s ,
68 .B \-g
69 and
70 .B \-T
71 are mutually exclusive flags.
72 If this is present,
73 .I {CLEARTEXT}
74 is used as scheme.
75 .B \-g
76 and
77 .B \-h
78 are mutually exclusive flags.
79 .TP
80 .BI \-T \ "file"
81 Hash the contents of the file.
82 If this,
83 .B \-g
84 and
85 .B \-s
86 are absent, the user will be prompted for the secret to hash.
87 .BR \-s ,
88 .B \-g
89 and
90 .B \-T
91 and mutually exclusive flags.
92 .TP
93 .BI \-h \ "scheme"
94 If \fB\-h\fP is specified, one of the following RFC 2307 schemes may
95 be specified:
96 .BR {CRYPT} ,
97 .BR {MD5} ,
98 .BR {SMD5} ,
99 .BR {SSHA} ", and"
100 .BR {SHA} .
101 The default is 
102 .BR {SSHA} .
103
104 Note that scheme names may need to be protected, due to
105 .B {
106 and
107 .BR } ,
108 from expansion by the user's command interpreter.
109
110 .B {SHA}
111 and
112 .B {SSHA}
113 use the SHA-1 algorithm (FIPS 160-1), the latter with a seed.
114
115 .B {MD5}
116 and
117 .B {SMD5}
118 use the MD5 algorithm (RFC 1321), the latter with a seed.
119
120 .B {CRYPT}
121 uses the
122 .BR crypt (3).
123
124 .B {CLEARTEXT}
125 indicates that the new password should be added to userPassword as
126 clear text.
127 Unless
128 .I {CLEARTEXT}
129 is used, this flag is incompatible with option
130 .BR \-g .
131 .TP
132 .BI \-c \ crypt-salt-format
133 Specify the format of the salt passed to
134 .BR crypt (3)
135 when generating {CRYPT} passwords.  
136 This string needs to be in
137 .BR sprintf (3)
138 format and may include one (and only one)
139 .B %s
140 conversion.
141 This conversion will be substituted with a string of random
142 characters from [A\-Za\-z0\-9./].  For example,
143 .RB ' %.2s '
144 provides a two character salt and
145 .RB ' $1$%.8s '
146 tells some
147 versions of
148 .BR crypt (3)
149 to use an MD5 algorithm and provides
150 8 random characters of salt.
151 The default is
152 .RB ' %s ' ,
153 which provides 31 characters of salt.
154 .TP
155 .BI \-n
156 Omit the trailing newline; useful to pipe the credentials
157 into a command.
158 .TP
159 .BI \-o \ option\fR[ = value\fR]
160 Specify an
161 .I option
162 with a(n optional)
163 .IR value .
164 Possible generic options/values are:
165 .LP
166 .nf
167               module\-path=<pathspec> (see `\fBmodulepath\fP' in slapd.conf(5))
168               module\-load=<filename> (see `\fBmoduleload\fP' in slapd.conf(5))
169
170 .in
171 You can load a dynamically loadable password hash module by
172 using this option.
173 .SH LIMITATIONS
174 The practice of storing hashed passwords in userPassword violates
175 Standard Track (RFC 4519) schema specifications and may hinder
176 interoperability.  A new attribute type, authPassword, to hold
177 hashed passwords has been defined (RFC 3112), but is not yet
178 implemented in
179 .BR slapd (8).
180 .LP
181 It should also be noted that the behavior of
182 .BR crypt (3)
183 is platform specific.
184 .SH "SECURITY CONSIDERATIONS"
185 Use of hashed passwords does not protect passwords during
186 protocol transfer.  TLS or other eavesdropping protections
187 should be in-place before using LDAP simple bind.
188 .LP
189 The hashed password values should be protected as if they
190 were clear text passwords.
191 .SH "SEE ALSO"
192 .BR ldappasswd (1),
193 .BR ldapmodify (1),
194 .BR slapd (8),
195 .BR slapd.conf (5),
196 .BR slapd\-config (5),
197 .B RFC 2307\fP,
198 .B RFC 4519\fP,
199 .B RFC 3112
200 .LP
201 "OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
202 .SH ACKNOWLEDGEMENTS
203 .so ../Project