port fix from branch_1_1
[freeradius.git] / man / man5 / rlm_passwd.5
1 .TH rlm_passwd 5 "14 April 2004" "" "FreeRADIUS Module"
2 .SH NAME
3 rlm_passwd \- FreeRADIUS Module
4 .SH DESCRIPTION
5 The \fIrlm_passwd\fP module provides authorization via files similar
6 in format to /etc/passwd.
7 .PP
8 The \frlm_passwd\fP module allows you to retrieve any account
9 information from any files with passwd-like format (/etc/passwd,
10 /etc/group, smbpasswd, .htpasswd, etc).  Every field of the file may
11 be mapped to a RADIUS attribute, with one of the fields used as a
12 key.
13 .PP
14 The module reads the file when it initializes, and caches the data
15 in memory.  As a result, it does not support dynamic updates of the
16 files (the server has to be HUP'd), but it is very fast, even for
17 files with thousands of lines.
18 .PP
19 The configuration item(s):
20 .IP filename
21 The path to the file.
22 .IP delimiter\ =\ ":"
23 The character to use as a delimiter between fields.  The default is
24 ":"
25 .IP hashsize
26 The size of the hashtable.  If 0, then the passwords are not cached
27 and the passwd file is parsed for every request.  We do not recommend
28 such a configuration.  A larger hashsize means less probability of
29 collision and faster search in hashtable. Having a hashsize in the range
30 of 30-100% of the number of passwd file records is reasonable.
31 .IP allowmultiplekeys
32 If set to 'yes', and more than one record in file matches the request,
33 then the attributes from all records will be used. If set to 'no' (the
34 default) the module will warn about duplicated records.
35 .IP ignorenislike
36 If set to 'yes', then all records from the file beginning with the '+'
37 sign will be ignored.  The default is 'no'.
38 .IP format
39 The format of the fields in the file, given as an example line from
40 the file, with the content of the fields as the RADIUS attributes
41 which the fields map to.  The fields are seperated by the ':' character.
42 .PP
43 The key field is signified by being preceded with a '*' character,
44 which indicates that the field has only one key, like the /etc/passwd
45 file.  The key field may instead be preceded with '*,', which
46 indicates that the field has multiple possible keys, like the
47 /etc/group file.
48 .PP
49 The other fields signify RADIUS attributes which, by default, are
50 added to the configuration items for a request. 
51 .PP
52 To add an attribute to the request (as though it was sent by the NAS),
53 prefix the attribute name in the "format" string with the '~' character.
54 .PP
55 To add an attribute to the reply (to be sent back to the NAS) prefix
56 the attribute name in the "format" string with the '=' character.
57 .IP ignoreempty
58 This configuration item defaults to "yes".  If there is no value for
59 the attribute, then the attribute is not added.  By setting this value
60 to "no", you can force the attribute to be added, even if there is no
61 value.
62
63 .SH EXAMPLES
64 .DS
65 format = "My-Group:::*,User-Name"
66 .DE
67 .IP
68 Parse a file similar to the /etc/group file.  An entry matches a
69 request when the name in a User-Name attribute exists in the
70 comma-seperated list of a line in the file.  When an entry matches, 
71 a "My-Group" attribute will be created and added to the configuration
72 items for the request.  The value of that attribute will be taken from
73 the first field of the matching line in the file.
74 .IP
75 The ":::" in the format string means that there are extra two fields
76 in the line, in between the group name and list of user names.  Those
77 fields do not map to any RADIUS attribute, and are therefore ignored.
78 .IP
79 For this example to work in practice, you will have to add the
80 My-Group attribute to the dictionary file.  See the dictionary manual
81 page for details on how this may be done.
82 .PP
83 .DS
84 format = "~My-Group:::*,User-Name"
85 .DE
86 .IP
87 Similar to the previous entry, except the My-Group attribute is added
88 to the request, as though it was sent by the NAS.
89 .SH SECTIONS
90 .BR authorize
91 .PP
92 .SH FILES
93 .I /etc/raddb/radiusd.conf
94 .PP
95 .SH "SEE ALSO"
96 .BR radiusd (8),
97 .BR radiusd.conf (5)
98 .BR dictionary (5),
99 .SH AUTHOR
100 Alan DeKok <aland@freeradius.org>
101