Imported Upstream version 0.63.0
[hcoop/debian/courier-authlib.git] / userdb / userdbpw.8.in
CommitLineData
d9898ee8 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:
8d138742
CE
6.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
7.\" Date: 08/23/2008
d9898ee8 8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\"
8d138742 11.TH "USERDBPW" "8" "08/23/2008" "Double Precision, Inc." "Double Precision, Inc."
d9898ee8 12.\" disable hyphenation
13.nh
14.\" disable justification (adjust text to left margin only)
15.ad l
16.SH "NAME"
8d138742 17userdbpw - create an encrypted password
d9898ee8 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
24enables secure entry of encrypted passwords into
8d138742 25\fI@userdb@\fR\.
d9898ee8 26.PP
27\fBuserdbpw\fR
8d138742 28reads a single line of text on standard input, encrypts it, and prints the encrypted result to standard output\.
d9898ee8 29.PP
30If standard input is attached to a terminal device,
31\fBuserdbpw\fR
8d138742 32explicitly issues a "Password: " prompt on standard error, and turns off echo while the password is entered\.
d9898ee8 33.PP
34The
35\fB\-md5\fR
8d138742 36option 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
d9898ee8 37\fBcrypt()\fR
8d138742 38function\.
d9898ee8 39.PP
40\fB\-hmac\-md5\fR
41and
42\fB\-hmac\-sha1\fR
8d138742 43options are available only if the userdb library is installed by an application that uses a challenge/response authentication mechanism\.
d9898ee8 44\fB\-hmac\-md5\fR
8d138742 45creates an intermediate HMAC context using the MD5 hash function\.
d9898ee8 46\fB\-hmac\-sha1\fR
8d138742 47uses the SHA1 hash function instead\. Whether either HMAC function is actually available depends on the actual application that installs the
d9898ee8 48\fBuserdb\fR
8d138742 49library\.
d9898ee8 50.PP
8d138742
CE
51Note 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
53database, which has group and world permissions turned off\. The userdb library also requires that the cleartext userdb source for the
54\fIuserdb\.dat\fR
d9898ee8 55and
8d138742
CE
56\fIuserdbshadow\.dat\fR
57databases is also stored with the group and world permissions turned off\.
d9898ee8 58.PP
59\fBuserdbpw\fR
60is usually used together in a pipe with
8d138742 61\fBuserdb\fR, which reads from standard input\. For example:
d9898ee8 62.sp
63.RS 4
64.nf
65\fBuserdbpw \-md5 | userdb users/john set systempw\fR
66.fi
67.RE
68.PP
69or:
70.sp
71.RS 4
72.nf
73\fBuserdbpw \-hmac\-md5 | userdb users/john set hmac\-md5pw\fR
74.fi
75.RE
76.PP
77These commands set the
78\fBsystempw\fR
79field in the record for the user
80\fBjohn\fR
81in
82\fI@userdb@/users\fR
83file, and the
84\fBhmac\-md5pw\fR
8d138742 85field\. Don\'t forget to run
d9898ee8 86\fBmakeuserdb\fR
8d138742 87for the change to take effect\.
d9898ee8 88.PP
89The 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
97However, this command passes the secret password as an argument to the
98\fBuserdb\fR
99command, which can be viewed by anyone who happens to run
100\fBps\fR(1)
8d138742 101at the same time\. Using
d9898ee8 102\fBuserdbpw\fR
103allows the secret password to be specified in a way that cannot be easily viewed by
8d138742 104\fBps\fR(1)\.
d9898ee8 105.SH "SEE ALSO"
106.PP
107
108\fI\fBuserdb\fR(8)\fR\&[1],
109\fI\fBmakeuserdb\fR(8)\fR\&[2]
8d138742 110.SH "NOTES"
d9898ee8 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