support 'user' and 'group' directives, where the server does
[freeradius.git] / raddb / radiusd.conf.in
1 ##
2 ## radiusd.conf -- FreeRADIUS server configuration file.
3 ##
4 ##      http://www.freeradius.org/
5 ##
6
7 #
8 #       The location of other config files and
9 #       logfiles are declared in this file
10 #
11 #       Also general configuration for modules can be done
12 #       in this file, it is exported through the API to
13 #       modules that ask for it.
14 #
15
16 # Stuff from autoconf
17 prefix = @prefix@
18 exec_prefix = @exec_prefix@
19 sysconfdir = @sysconfdir@
20 localstatedir = @localstatedir@
21 sbindir = @sbindir@
22 logdir = @logdir@
23 libdir = @libdir@
24 raddbdir = @raddbdir@
25 radacctdir = @radacctdir@
26
27 #
28 #  Location of config and logfiles.
29 #
30 confdir    = ${raddbdir}
31
32 run_dir    = ${localstatedir}/run
33
34 #
35 #  pidfile: Where to place the PID of the RADIUS server.
36 #
37 #  The server may be signalled while it's running by using this
38 #  file.
39 #
40 #  e.g.:  kill -HUP `cat /var/run/radiusd.pid`
41 #
42 pidfile    = ${run_dir}/radiusd.pid
43
44 #
45 # user/group: The name (or #number) of the user/group to run httpd as.
46 #    On SCO (ODT 3) use "user = nouser" and "group = nogroup".
47 #    On HPUX you may not be able to use shared memory as nobody, and the
48 #    suggested workaround is to create a user www and use that user.
49 #
50 #  NOTE that some kernels refuse to setgid(group)
51 #  when the value of (unsigned)group is above 60000;
52 #  don't use group nobody on these systems!
53 #
54 #  On systems with shadow passwords, you might have to set 'group = shadow'
55 #  for the server to be able to read the shadow password file.
56 #
57 user = nobody
58 group = nobody
59
60 #
61 #  max_request_time: The maximum time (in seconds) to handle a request.
62 #
63 #  Requests which take more time than this to process are killed, and
64 #  a REJECT message is returned.
65 #
66 #  Useful range of values: 5 to 120
67 #
68 max_request_time        = 30
69
70 #
71 #  cleanup_delay: The time to wait (in seconds) before cleaning up
72 #  a reply which was sent to the NAS.
73 #
74 #  The RADIUS request is normally cached internally for a short period
75 #  of time, after the reply is sent to the NAS.  The reply packet may be
76 #  lost in the network, and the NAS will not see it.  The NAS will then
77 #  re-send the request, and the server will respond quickly with the
78 #  cached reply.
79 #
80 #  If this value is set too low, then duplicate requests from the NAS
81 #  MAY NOT be detected, and will instead be handled as seperate requests.
82 #
83 #  If this value is set too high, then the server will cache too many
84 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
85 #
86 #  Useful range of values: 2 to 10
87 #
88 cleanup_delay           = 5
89
90 #
91 #  max_requests: The maximum number of requests which the server keeps
92 #  track of.  This should be 256 multiplied by the number of clients.
93 #  e.g. With 4 clients, this number should be 1024.
94 #
95 #  If this number is too low, then when the server becomes busy,
96 #  it will not respond to any new requests, until the 'cleanup_delay'
97 #  time has passed, and it has removed the old requests.
98 #
99 #  If this number is set too high, then the server will use a bit more
100 #  memory for no real benefit.
101 #
102 #  If you aren't sure what it should be set to, it's better to set it
103 #  too high than too low.  Setting it to 1000 per client is probably
104 #  the highest it should be.
105 #
106 #  Useful range of values: 256 to infinity
107 #
108 max_requests            = 1024
109
110 #
111 #  bind_address:  Make the server listen on a particular IP address, and
112 #  send replies out from that address.  This directive is most useful
113 #  for machines with multiple IP addresses on one interface.
114 #
115 #  It can either contain "*", or an IP address, or a fully qualified
116 #  Internet domain name.  The default is "*"
117 #
118 bind_address            = *
119
120 #
121 #  port: Allows you to bind FreeRADIUS to a specific port.
122 #
123 #  The default port that most NAS boxes use is 1645, which is historical.
124 #  RFC 2138 defines 1812 to be the new port.  Many new servers and
125 #  NAS boxes use 1812, which can create interoperability problems.
126 #
127 #  The port is defined here to be 0 so that the server will pick up
128 #  the machine's local configuration for the radius port, as defined
129 #  in /etc/services.
130 #
131 #  If you want to use the default RADIUS port as defined on your server,
132 #  (usually through 'grep radius /etc/services') set this to 0 (zero).
133 #
134 #  A port given on the command-line via '-p' over-rides this one.
135 #
136 port = 0
137
138 #
139 #  Which program to execute check doing concurrency checks.
140 #
141 checkrad   = ${sbindir}/checkrad
142
143 #
144 #  hostname_lookups: Log the names of clients or just their IP addresses
145 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
146 #  The default is off because it'd be overall better for the net if people
147 #  had to knowingly turn this feature on, since enabling it means that
148 #  each client request will result in AT LEAST one lookup request to the
149 #  nameserver.
150 #
151 #  Turning hostname lookups off also means that the server won't block
152 #  for 30 seconds, if it sees an IP address which has no name associated
153 #  with it.
154 #
155 # allowed values: {no, yes}
156 #
157 hostname_lookups        = no
158
159 #
160 #  Core dumps are a bad thing.  This should only be set to 'yes'
161 #  if you're debugging a problem with the server.
162 #
163 # allowed values: {no, yes}
164 #
165 allow_core_dumps        = no
166
167 #
168 #  Log the full User-Name attribute, as it was found in the request.
169 #
170 # allowed values: {no, yes}
171 #
172 log_stripped_names      = no
173
174 #
175 #  Log authentication requests to the log file.
176 #
177 # allowed values: {no, yes}
178 #
179 log_auth        = no
180
181 #
182 #  Log passwords with the authentication requests.
183 #
184 # allowed values: {no, yes}
185 #
186 log_auth_pass   = no
187
188
189 # usercollide:  Turn user collision code on and off.
190 #               See README.usercollide
191 #
192 usercollide = no
193
194 #
195 # lower_user / lower_pass:  
196 # Lowercase the username/password before processing it
197 # This is as close as we can get to case insensitivity.  It is
198 # the admin's job to ensure that the username on the auth
199 # db side is *also* lowercase to make this work
200 # Default is 'no' (don't lowercase values)
201 #
202 lower_user = no
203 lower_pass = no
204
205
206 # If you have configured above to lowercase the username and
207 # password, you can decide here *when* to do that.  You can
208 # lowercase them "before" any processing occurs, or you can
209 # lowercase "after" authentication processing once and the
210 # server will retry with the new lowercased values.
211 #
212 # Valid values:  "before" / "after"
213 lower_time = before
214
215 # nospace_user / nospace_pass:
216 # Some users like to enter spaces in their username or
217 # password incorrectly.  To save yourself the tech support
218 # call, you can eliminate those spaces here:
219 # Default is 'no' (don't remove spaces)
220 nospace_user = no
221 nospace_pass = no
222
223 #
224 # See above for lower_time explanation.  Works the same way
225 # except does nospace processing.
226 #
227 # Valid values:  "before" / "after"
228 nospace_time = before
229
230
231 #######################################################################
232 #
233 #  Include optional/module specific configurations.
234
235
236 # PROXY CONFIGURATION
237 #
238 #  proxy_requests: Turns proxying of RADIUS requests on or off.
239 #
240 #  The server has proxying turned on by default.  If your system is NOT
241 #  set up to proxy requests to another server, then you can turn proxying
242 #  off here.  This will save a small amount of resources on the server.
243 #
244 #  If you have proxying turned off, and your configuration files say
245 #  to proxy a request, then an error message will be logged.
246 #
247 # allowed values: {no, yes}
248 #
249 #  To disable proxying, change the "yes" to "no", and comment the
250 #  $INCLUDE line.
251 proxy_requests  = yes
252 $INCLUDE     ${confdir}/proxy.conf
253
254 # CLIENTS CONFIGURATION
255 #
256 #  Client configuration is defined in "clients.conf".  If you don't
257 #  use the "clients.conf", you can comment the following.  The use of
258 #  "clients.conf" is recommended over the old "clients", though both
259 #  are supported.
260 #
261 $INCLUDE      ${confdir}/clients.conf
262
263 # SNMP CONFIGURATION
264 #
265 #  Snmp configuration is only valid if you enabled SNMP support when
266 #  you compiled radius.  To enable SNMP configuration, uncomment the
267 #  following line.
268 $INCLUDE      ${confdir}/snmp.conf
269
270
271 #######################################################################
272 #
273 #  Thread pool configuration.
274 #
275 #  The thread pool is a long-lived group of threads which
276 #  take turns (round-robin) handling any incoming requests.
277 #
278 #
279 #  You probably want to have a few spare threads around,
280 #  so that high-load situations can be handled immediately.  If you
281 #  don't have any spare threads, then the request handling will
282 #  be delayed while a new thread is created, and added to the pool.
283 #
284 #  You probably don't want too many spare threads around,
285 #  otherwise they'll be sitting there taking up resources, and
286 #  not doing anything productive.
287 #
288 #  The numbers given below should be adequate for most situations.
289 #
290 #
291 thread pool {
292 #
293 #  Number of servers to start initially --- should be a reasonable ballpark
294 #  figure.
295 #
296         start_servers     = 5
297
298 #
299 #  Limit on the total number of servers running.
300 #
301 #  If this limit is ever reached, clients will be LOCKED OUT, so it
302 #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
303 #  keep a runaway server from taking the system with it as it spirals
304 #  down...
305 #
306         max_servers       = 32
307
308 #
309 #  Server-pool size regulation.  Rather than making you guess how many
310 #  servers you need, FreeRADIUS dynamically adapts to the load it
311 #  sees --- that is, it tries to maintain enough servers to
312 #  handle the current load, plus a few spare servers to handle transient
313 #  load spikes.
314 #
315 #  It does this by periodically checking how many servers are waiting
316 #  for a request.  If there are fewer than min_spare_servers, it creates
317 #  a new spare.  If there are more than max_spare_servers, some of the
318 #  spares die off.  The default values are probably OK for most sites.
319 #
320         min_spare_servers = 3
321         max_spare_servers = 10
322
323 #
324 #  There may be memory leaks or resource allocation problems with
325 #  the server.  If so, set this value to 300 or so, so that the
326 #  resources will be cleaned up periodically.
327 #
328 #  This should only be necessary if there are serious bugs in the
329 #  server which have not yet been fixed.
330 #
331 #  '0' is a special value meaning 'infinity', or 'the servers never exit'
332 #
333         max_requests_per_server = 0
334 }
335
336 modules {
337         pam {
338                 # No config options for this yet
339         }
340         unix {
341                 #
342                 #  Cache /etc/passwd, /etc/shadow, and /etc/group
343                 #
344                 #  The default is to NOT cache them.  However, caching them can
345                 #  speed up system authentications by a substantial amount.
346                 #
347                 # allowed values: {no, yes}
348                 cache           = no
349
350                 #
351                 #  Define the locations of the normal passwd, shadow, and
352                 #  group files.
353                 #
354                 #  'shadow' is commented out by default, because not all
355                 #  systems have shadow passwords.
356                 #
357                 passwd          = /etc/passwd
358                 #       shadow          = /etc/shadow
359                 group           = /etc/group
360         }
361
362 # Uncomment this if you want to use ldap (Auth-Type = LDAP)
363 # Also uncomment it in the authenticate{} block below
364 #       ldap {
365 #               server   = localhost
366 #               login    = "cn=admin,o=My Org,c=US"
367 #               password = mypass
368 #               basedn   = "o=My Org,c=US"
369 #               filter   = "(uid=%u)"
370 #       }
371
372         #
373         #  You can have multiple instances of the realm module to
374         #  support multiple realm syntaxs at the same time.  The
375         #  search order is defined the order in the authorize and
376         #  preacct blocks after the module config block.
377         #
378         #  Two config options:
379         #       format     -  must be 'prefix' or 'suffix'
380         #       delimiter  -  must be a single character
381         #
382         #  'username@realm'
383         #
384         realm suffix {
385                 format = suffix
386                 delimiter = "@"
387         }
388
389         #  'realm/username'
390         #
391         #realm prefix {
392         #       format = prefix
393         #       delimiter = "/"
394         #}
395
396         #  'username%realm'
397         #
398         #realm percent {
399         #       format = suffix
400         #       delimiter = "%"
401         #}
402         
403         preprocess {
404                 huntgroups = ${confdir}/huntgroups
405                 hints = ${confdir}/hints
406
407                 #
408                 # This hack changes Ascend's wierd port numberings
409                 # to standard 0-??? port numbers so that the "+" works
410                 # for IP address assignments.
411                 #
412                 with_ascend_hack = no
413                 ascend_channels_per_line = 23
414
415                 #
416                 # Windows NT machines often authenticate themselves as
417                 # NT_DOMAIN\username
418                 #
419                 # If this is set to 'yes', then the NT_DOMAIN portion
420                 # of the user-name is silently discarded.
421                 #
422                 with_ntdomain_hack = no
423
424                 #
425                 # Specialix Jetstream 8500 24 port access server.
426                 #
427                 # If the user name is 10 characters or longer, a "/"
428                 # and the excess characters after the 10th are
429                 # appended to the user name.
430                 #
431                 # If you're not running that NAS, you don't need
432                 # this hack.
433                 #
434                 with_specialix_jetstream_hack = no
435         }
436         files {
437                 usersfile = ${confdir}/users
438                 acctusersfile = ${confdir}/acct_users
439
440                 #
441                 #  If you want to use the old Cistron 'users' file
442                 #  with FreeRADIUS, you should change the next line
443                 #  to 'compat = cistron'.  You can the copy your 'users'
444                 #  file from Cistron.
445                 #
446                 compat = no
447         }
448
449         # See README.rlm_fastusers before using this
450         # module or changing these values
451   fastusers {
452     usersfile = ${confdir}/users_fast
453     hashsize = 1000
454     compat = no
455                 normal_defaults = yes
456   }
457         
458         detail {
459                 detailfile = %A/%n/detail
460                 detailperm = 0600
461         }
462
463         # This module will add a (probably) unique session id 
464         # to an accounting packet based on the attributes listed
465         # below found in the packet.  see doc/README.rlm_acct_unique
466         acct_unique {
467                 key = "User-Name, Acct-Session-Id, NAS-IP-Address, NAS-Port-Id"
468         }
469
470
471 #
472 #  Configuration for the SQL module.
473 #
474         sql {
475         
476                 # Connect info
477                 server          = "localhost"
478                 login           = "root"
479                 password        = "rootpass"
480                 
481                 # Database table configuration
482                 radius_db       = "radius"
483                 acct_table      = "radacct"
484                 
485                 authcheck_table = "radcheck"
486                 authreply_table = "radreply"
487                 
488                 groupcheck_table = "radgroupcheck"
489                 groupreply_table = "radgroupreply"
490                 
491                 usergroup_table = "usergroup"
492                 
493                 realms_table    = "realms"
494                 realmgroup_table = "realmgroup"
495                 
496                 # Check case on usernames
497                 sensitiveusername = no
498         
499                 # Remove stale session if checkrad does not see a double login
500                 deletestalesessions = yes
501         
502                 # Print all SQL statements when in debug mode (-x)
503                 sqltrace        = no
504                 sqltracefile = ${logdir}/sqltrace.sql
505
506                 # number of sql connections to make to server
507                 num_sql_socks = 5
508         }
509
510 #
511 #  A second instance of the same module, with the name "sql2" to identify it
512 #
513         sql sql2 {
514         
515                 # Connect info
516                 server          = "myothersever"
517                 login           = "root"
518                 password        = "rootpass"
519                 
520                 # Database table configuration
521                 radius_db       = "radius"
522                 acct_table      = "radacct"
523                 
524                 authcheck_table = "radcheck"
525                 authreply_table = "radreply"
526                 
527                 groupcheck_table = "radgroupcheck"
528                 groupreply_table = "radgroupreply"
529                 
530                 usergroup_table = "usergroup"
531                 
532                 realms_table    = "realms"
533                 realmgroup_table = "realmgroup"
534                 
535                 # Check case on usernames
536                 sensitiveusername = no
537         
538                 # Remove stale session if checkrad does not see a double login
539                 deletestalesessions = yes
540         
541                 # Print all SQL statements when in debug mode (-x)
542                 sqltrace        = no
543         }
544
545 #######################################################################
546 #
547 #       Configuration for the example module.  Uncommenting it will cause it
548 #       to get loaded and initialized, but should have no real effect as long
549 #       it is not referencened in one of the autz/auth/preacct/acct sections
550 #
551        example {
552        #
553        #  Boolean variable.
554        #
555        # allowed values: {no, yes}
556        #
557                boolean          = yes
558
559        #
560        #  An integer, of any value.
561        #
562                integer          = 16
563
564        #
565        #  A string.
566        #
567                string           = "This is an example configuration string"
568
569        #
570        # An IP address, either in dotted quad (1.2.3.4) or hostname
571        # (example.com)
572        #
573                ipaddr           = 127.0.0.1
574
575        #
576        # A subsection
577        #
578                mysubsection {
579                        anotherinteger = 1000
580        #
581        # They nest
582        #
583                        deeply nested {
584                                string = "This is a different string"
585                        }
586                }
587        }
588 }
589
590 # Authentication types, Auth-Type = System and PAM for now.
591 authenticate {
592         pam
593         unix
594 # By grouping modules together in an authtype block, that authtype will be
595 # tried on each module in sequence until one returns REJECT or OK. This
596 # allows authentication failover if the first SQL server has crashed, for
597 # example.
598 #       authtype SQL {
599 #               sql
600 #               sql2
601 #       }
602 # Uncomment this if you want to use ldap (Auth-Type = LDAP)
603 #       ldap
604 }
605
606 # Authorization. First preprocess (hints and huntgroups files),
607 # then realms, and finally look in the "users" file.
608 # The order of the realm modules will determine the order that
609 # we try to find a matching realm.
610 # Make *sure* that 'preprocess' comes before any realm if you 
611 # need to setup hints for the remote radius server
612 authorize {
613         preprocess
614         suffix
615         files
616 }
617
618 # Pre-accounting. Look for proxy realm in order of realms, then 
619 # acct_users file, then preprocess (hints file).
620 preacct {
621         suffix
622         files
623         preprocess
624 }
625
626 # Accounting. Log to detail file, and to the radwtmp file.
627 accounting {
628         #acct_unique
629         detail
630         unix
631 }
632
633 # Session database, used for checking Simultaneous-Use. The radutmp module
634 # handles this
635 session {
636        radutmp
637 }