Imported upstream version 0.59.3
[hcoop/debian/courier-authlib.git] / userdb / userdbpw.8.in
1 .\" <!-- $Id: userdbpw.sgml,v 1.5 2007/04/22 15:05:16 mrsam Exp $ -->
2 .\" <!-- Copyright 1998 - 2007 Double Precision, Inc. See COPYING for -->
3 .\" <!-- distribution information. -->
4 .\" Title: userdbpw
5 .\" Author:
6 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
7 .\" Date: 04/22/2007
8 .\" Manual: Double Precision, Inc.
9 .\" Source: Double Precision, Inc.
10 .\"
11 .TH "USERDBPW" "8" "04/22/2007" "Double Precision, Inc." "Double Precision, Inc."
12 .\" disable hyphenation
13 .nh
14 .\" disable justification (adjust text to left margin only)
15 .ad l
16 .SH "NAME"
17 userdbpw \- create an encrypted password
18 .SH "SYNOPSIS"
19 .HP 9
20 \fBuserdbpw\fR [[\-md5] | [\-hmac\-md5] | [\-hmac\-sha1]] |\fBuserdb\fR {\fIname\fR} set {\fIfield\fR}
21 .SH "DESCRIPTION"
22 .PP
23 \fBuserdbpw\fR
24 enables secure entry of encrypted passwords into
25 \fI@userdb@\fR.
26 .PP
27 \fBuserdbpw\fR
28 reads a single line of text on standard input, encrypts it, and prints the encrypted result to standard output.
29 .PP
30 If standard input is attached to a terminal device,
31 \fBuserdbpw\fR
32 explicitly issues a "Password: " prompt on standard error, and turns off echo while the password is entered.
33 .PP
34 The
35 \fB\-md5\fR
36 option is available on systems that use MD5\-hashed passwords (such as systems that use the current version of the PAM library for authenticating, with MD5 passwords enabled). This option creates an MD5 password hash, instead of using the traditional
37 \fBcrypt()\fR
38 function.
39 .PP
40 \fB\-hmac\-md5\fR
41 and
42 \fB\-hmac\-sha1\fR
43 options are available only if the userdb library is installed by an application that uses a challenge/response authentication mechanism.
44 \fB\-hmac\-md5\fR
45 creates an intermediate HMAC context using the MD5 hash function.
46 \fB\-hmac\-sha1\fR
47 uses the SHA1 hash function instead. Whether either HMAC function is actually available depends on the actual application that installs the
48 \fBuserdb\fR
49 library.
50 .PP
51 Note that even though the result of HMAC hashing looks like an encrypted password, it's really not. HMAC\-based challenge/response authentication mechanisms require the cleartext password to be available as cleartext. Computing an intermediate HMAC context does scramble the cleartext password, however if its compromised, it WILL be possible for an attacker to succesfully authenticate. Therefore, applications that use challenge/response authentication will store intermediate HMAC contexts in the "pw" fields in the userdb database, which will be compiled into the
52 \fIuserdbshadow.dat\fR
53 database, which has group and world permissions turned off. The userdb library also requires that the cleartext userdb source for the
54 \fIuserdb.dat\fR
55 and
56 \fIuserdbshadow.dat\fR
57 databases is also stored with the group and world permissions turned off.
58 .PP
59 \fBuserdbpw\fR
60 is usually used together in a pipe with
61 \fBuserdb\fR, which reads from standard input. For example:
62 .sp
63 .RS 4
64 .nf
65 \fBuserdbpw \-md5 | userdb users/john set systempw\fR
66 .fi
67 .RE
68 .PP
69 or:
70 .sp
71 .RS 4
72 .nf
73 \fBuserdbpw \-hmac\-md5 | userdb users/john set hmac\-md5pw\fR
74 .fi
75 .RE
76 .PP
77 These commands set the
78 \fBsystempw\fR
79 field in the record for the user
80 \fBjohn\fR
81 in
82 \fI@userdb@/users\fR
83 file, and the
84 \fBhmac\-md5pw\fR
85 field. Don't forget to run
86 \fBmakeuserdb\fR
87 for the change to take effect.
88 .PP
89 The following command does the same thing:
90 .sp
91 .RS 4
92 .nf
93 \fBuserdb users/john set systempw=\fR\fB\fBSECRETPASSWORD\fR\fR
94 .fi
95 .RE
96 .PP
97 However, this command passes the secret password as an argument to the
98 \fBuserdb\fR
99 command, which can be viewed by anyone who happens to run
100 \fBps\fR(1)
101 at the same time. Using
102 \fBuserdbpw\fR
103 allows the secret password to be specified in a way that cannot be easily viewed by
104 \fBps\fR(1).
105 .SH "SEE ALSO"
106 .PP
107
108 \fI\fBuserdb\fR(8)\fR\&[1],
109 \fI\fBmakeuserdb\fR(8)\fR\&[2]
110 .SH "REFERENCES"
111 .IP " 1." 4
112 \fBuserdb\fR(8)
113 .RS 4
114 \%userdb.html
115 .RE
116 .IP " 2." 4
117 \fBmakeuserdb\fR(8)
118 .RS 4
119 \%makeuserdb.html
120 .RE