xref: /openbsd/usr.sbin/radiusd/radiusd.conf.5 (revision 4cfece93)
1.\"	$OpenBSD: radiusd.conf.5,v 1.14 2020/04/23 21:28:10 jmc Exp $
2.\"
3.\" Copyright (c) 2014 Esdenera Networks GmbH
4.\" Copyright (c) 2014 Internet Initiative Japan Inc.
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: April 23 2020 $
19.Dt RADIUSD.CONF 5
20.Os
21.Sh NAME
22.Nm radiusd.conf
23.Nd RADIUS daemon configuration file
24.Sh DESCRIPTION
25.Nm
26is the configuration file for the RADIUS daemon,
27.Xr radiusd 8 .
28It has the following format:
29.Pp
30Empty lines and lines beginning with the
31.Sq #
32character are ignored.
33.Pp
34Keywords may be specified multiple times within the configuration file.
35The configuration options are as follows:
36.Bl -tag -width Ds
37.It Xo
38.Ic listen on Ar address
39.Ic port Ar port
40.Xc
41Specify an
42.Ar address
43and a
44.Ar port
45to listen on.
46.It Ic client Ar address/mask Brq ...
47Allow access to a client with the specified
48.Ar address
49and
50.Ar mask .
51It is followed by a block of options enclosed in curly brackets:
52.Bl -tag -width Ds
53.It Ic secret Ar secret
54The shared secret with the clients.
55This option cannot be omitted.
56.It Ic msgauth-required Ar yes | no
57Message authentication is required if
58.Dq yes
59is specified.
60.El
61.It Ic module load Ar name path
62Load a module
63from
64.Ar path
65and name it with the given
66.Ar name .
67The following modules are available:
68.Bl -column "/usr/libexec/radiusd/radiusd_bsdauthXXX"
69.It Sy "Path" Ta Sy "Description"
70.It Pa /usr/libexec/radiusd/radiusd_bsdauth Ta Do bsdauth Dc module
71.It Pa /usr/libexec/radiusd/radiusd_radius Ta Do radius Dc module
72.El
73.Bl -tag -width Ds
74.It Do bsdauth Dc module
75The
76.Dq bsdauth
77module provides authentication from the local system's
78.Xr authenticate 3
79interface,
80known as
81.Dq bsd auth .
82It only supports PAP, password based authentication.
83.It Do radius Dc module
84The
85.Dq radius
86module provides authentication from upstream RADIUS servers.
87.El
88.It Ic module set Ar module key value ...
89Configure the module specific configurations by
90.Ar key
91and
92.Ar value
93for the module specified by
94.Ar module .
95Notice that
96.Ar module ,
97.Ar key ,
98and
99.Ar value
100must be quoted to be distinguished from the reserved word (e.g.\&
101.Dq secret )
102if needed.
103.Pp
104The
105.Dq bsdauth
106module supports the following configuration key and value:
107.Bl -tag -width Ds -offset indent
108.It Ic restrict-group Ar group ...
109Restrict login only if the user is a member of the specified groups.
110.El
111.Pp
112The
113.Dq radius
114module supports the following configuration key and value:
115.Bl -tag -width Ds -offset indent
116.It Ic server Ar address Ns Op : Ns Ar port
117Specify the upstream server's address and port.
118If
119.Ar port
120is omitted, 1812 is used.
121This configuration can be specified multiple times.
122.It Ic secret Ar secret
123Specify the shared secret with the servers.
124This configuration cannot be omitted.
125.It Ic max-tries Ar number
126Specify the maximum number of retransmissions for a server.
127.Xr radiusd 8
128will retransmit 2, 6, 14, 22, and 30 seconds after the first transmission.
129If the number of retransmissions per server reaches this value,
130the current server is marked as
131.Dq fail ,
132and the next server is used for subsequent requests.
133The default value is 3.
134.It Ic max-failovers Ar number
135If a positive number is specified,
136.Xr radiusd 8
137will failover to the next server
138when the current server is marked
139.Dq fail .
140This key and value specifies the maximum number of failovers.
141The default value is 0.
142.It Ic request-timeout Ar sec
143Specify the request timeout in seconds.
144If this value is specified,
145.Ar max-tries
146and
147.Ar max-failover
148will not be used.
149.El
150.It Ic authenticate Ar username-pattern ... Brq ...
151Specify an authentication configuration for the users specified by
152.Ar username-pattern .
153Use shell globbing rules for the pattern;
154multiple patterns can be specified by separating with space characters.
155When multiple
156.Ic authenticate
157lines are specified, the first
158.Ic authenticate
159setting whose
160.Ar username-pattern
161matches an authenticating user is used.
162It is followed by a block of options enclosed in curly brackets:
163.Bl -tag -width Ds
164.It Ic authenticate-by Ar module
165Specify the module name.
166.El
167.El
168.Sh FILES
169.Bl -tag -width "/usr/libexec/radiusd/radiusd_bsdauth" -compact
170.It Pa /etc/radiusd.conf
171Default
172.Xr radiusd 8
173configuration file.
174.It Pa /etc/examples/radiusd.conf
175Example configuration file.
176.It Pa /usr/libexec/radiusd/radiusd_bsdauth
177.Dq bsdauth
178module executable.
179.It Pa /usr/libexec/radiusd/radiusd_radius
180.Dq radius
181module executable.
182.El
183.Sh EXAMPLES
184.Bd -literal -offset indent
185listen on 0.0.0.0
186#listen on ::
187
188client 127.0.0.1/32 {
189	secret "secret"
190}
191client 192.168.0.0/24 {
192	secret "secret"
193	msgauth-required yes
194}
195
196module load "bsdauth" "/usr/libexec/radiusd/radiusd_bsdauth"
197module set "bsdauth"  "restrict-group" "operator"
198
199module load "radius" "/usr/libexec/radiusd/radiusd_radius"
200module set "radius" "secret" "testing123"
201module set "radius" "server" "127.0.0.1"
202
203authenticate *@example.com {
204	authenticate-by "radius"
205}
206authenticate * {
207	authenticate-by "bsdauth"
208}
209.Ed
210.Sh SEE ALSO
211.Xr authenticate 3 ,
212.Xr radiusd 8
213