Chinaunix首页 | 论坛 | 博客
  • 博客访问: 251165
  • 博文数量: 93
  • 博客积分: 3001
  • 博客等级: 中校
  • 技术积分: 1050
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-11 13:20
文章分类

全部博文(93)

文章存档

2011年(1)

2009年(92)

我的朋友

分类: LINUX

2009-07-11 22:55:23

Radiusd.conf文件是freeradius的核心配置文件,其中设置了 服务器的基本信息, 配置文件与日志文件的环境变量,并详细配置freeradius模块所使用的信息, 与认证和计费所使用模块的配置. 配置的变量定义的形式为${foo},他们就在这个文件上,并且不随请求到请求而改变. 变量的格式参照 variables.txt.

环境变量

此处定义其他配置文件以及目录的位置,也就是环境变量

prefix = /usr/local

exec_prefix = ${prefix}

sysconfdir = ${prefix}/etc

localstatedir = ${prefix}/var

sbindir = ${exec_prefix}/sbin

logdir = ${localstatedir}/log/radius

raddbdir = ${sysconfdir}/raddb

radacctdir = ${logdir}/radacct

配置文件和日志文件的位置

confdir = ${raddbdir}

run_dir = ${localstatedir}/run/radiusd

日志文件的信息,添加到如下配置文件的底部

log_file = ${logdir}/radius.log

全局配置

模块的位置由 libdir来配置。

如果不能工作,那么你可以从新配置,从新Build源码,并且使用 共享库。

pidfile: Where to place the PID of the RADIUS server.

pidfile = ${run_dir}/radiusd.pid

user/group

如果有评论,服务器会运行 用户/ 启动它. 修改用户/组,必须具有root权限启动服务器

这里的含义是指定启动radius服务可以限定操作系统上的用户和组,但是不建议启动它.

#user = nobody

#group = nobody

最长请求时间(),这样的问题经常需要存在在应用SQL数据库时候,建议设置为5秒到120秒之间.

max_request_time = 30

当请求超过最长请求时间的时候,可以设置服务器删除请求.

当你的服务在threaded(线程下)运行,或者 线程池(thread pool) 模式,建议这里设置为no.

但用threaded 服务设置为yes时,有可能使服务器崩溃.

delete_blocked_requests = no

reply 发送给NAS后的等待清空时间. 建议 2 10

cleanup_delay = 5

服务器的请求最大数 ,建议值 256 到无穷

max_requests = 1024

让服务器监听某个IP,并且从次IP发送 相应 信息. 主要是为了 服务器同时具有多服务器时候使用.

bind_address = *

可以指定raidus的使用端口号,使用0表示使用默认的radius端口, 在配置文件 /etc/services配置.

port = 0

如果需要服务器同时监听其他的IP,可以用listen . 下面是例子

#listen {

# IP address on which to listen.

# Allowed values are:

# dotted quad (1.2.3.4)

# hostname (radius.example.com)

# wildcard (*)

# ipaddr = *

# Port on which to listen.

# Allowed values are:

# integer port number (1812)

# 0 means "use /etc/services for the proper port"

# port = 0

# Type of packets to listen for.

# Allowed values are:

# auth listen for authentication packets

# acct listen for accounting packets

#

# type = auth

#}

hostname_lookups大概是表示为NAS查找它的域名信息?可以通过域名配置NAS?

hostname_lookups = no

是否允许 core dumps.

allow_core_dumps = no

expressions支持,规则和扩展.

regular_expressions = yes

extended_expressions = yes

记录User-Name属性的全称.

log_stripped_names = no

是否记录认证请求信息到日志文件

log_auth = no

当请求被拒绝时记录密码, 当请求正确时记录密码

log_auth_badpass = no

log_auth_goodpass = no

是否允许用户名冲突,即重复同用户同时登陆.强烈不建议启用重复用户.

usercollide = no

将用户名 小写化, 将密码小写化.

lower_user = no

lower_pass = no

是否去除用户名和密码中的空格

nospace_user = no

nospace_pass = no

程序执行并发检查(不理解含义)

checkrad = ${sbindir}/checkrad

安全 配置

security {

指在Radius包中的最大属性数目.设置为0表示无穷大.

max_attributes = 200

发送 Access-Reject 包时候,可以设置一定的延迟,以缓慢DOS攻击,也可以缓慢穷举破解用户名和密码的攻击

reject_delay = 1

服务器是否对状态服务器的请求信息进行相应.

status_server = no

}

PROXY CONFIGURATION

代理域.

是否开启代理服务,具体配置参照 ${confdir}/proxy.conf

proxy_requests = yes

$INCLUDE ${confdir}/proxy.conf

Clients配置

$INCLUDE ${confdir}/clients.conf

是否启用snmp配置,具体配置文件在snmp.conf

snmp = no

$INCLUDE ${confdir}/snmp.conf

线程池 配置

thread pool {

启动时服务的个数.(在启动Mysql模块后可以明显看到.)当同时进行的请求数超过5个时,会增加线程服务.

start_servers = 5

最大的服务数

max_servers = 32

当少于最少空闲服务时,它会建立服务,大于最大空闲服务时会停止多余的服务.

最少空闲服务,与最大空闲服务.

min_spare_servers = 3

max_spare_servers = 10

每个server最大的请求数.当有内存漏洞时,可能需要配置.

max_requests_per_server = 0

}

模块配置

1.3.1 PAP 模块

# Supports multiple encryption schemes 支持多种加密方式

# clear: Clear text 明文

# crypt: Unix crypt Unix 加密

# md5: MD5 ecnryption MD5加密

# sha1: SHA1 encryption. SHA1加密

# DEFAULT: crypt 默认是Unix加密

pap {

encryption_scheme = crypt

}

1.3.2 CHAP模块

chap {

authtype = CHAP

}

1.3.3 PAM模块

PAM模块 (PAM) 是行业标准验证框架,

鉴于很多系统的PAM库都有内存漏洞,所以不建议使用。

pam {

pam_auth = radiusd

}

1.3.4 UNIX 系统用户的 认证模块

unix {

cache = no

cache_reload = 600

# passwd = /etc/passwd

# shadow = /etc/shadow

# group = /etc/group

radwtmp = ${logdir}/radwtmp

}

1.3.5 EAP模块

详细见${confdir}/eap.conf

$INCLUDE ${confdir}/eap.conf

1.3.6 MSCHAP 模块

mschap {

#use_mppe = no

#require_encryption = yes

#require_strong = yes

# 为了纠正window发送chap时有时包括域,有时又不包括域的信息.

#with_ntdomain_hack = no#ntlm_auth = "/path/to/ntlm_auth –request-nt-key –username=%{Stripped-User-Name:-%{User-Name:-None}} –challenge=%{mschap:Challenge:-00} –nt-response=%{mschap:NT-Response:-00}"

}

1.3.7 LDAP 配置 模块

LDAP模块只能在Access-Request packet 中包含明文密码属性才可以被使用。LDAP认证不能在其他任何认证方法中使用。

具体配置详见下属章节。(参看doc/rlm_ldap)。

1.3.8 passwd 模块

Passwd模块允许通过任何passwd样式的文件进行授权,并可以从这些模块中提取属性信息。

smbpasswd例子

#passwd etc_smbpasswd {

# filename = /etc/smbpasswd

# format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"

# authtype = MS-CHAP

# hashsize = 100

# ignorenislike = no

# allowmultiplekeys = no

#}

#passwd etc_group {

# filename = /etc/group

# format = "=Group-Name:::*User-Name"

# hashsize = 50

# ignorenislike = yes

# allowmultiplekeys = yes

# delimiter = ":"

#}

1.3.9 Realm 模块

应用在代理上. You can have multiple instances of the realm module to support multiple realm syntaxs at the same time. The search order is defined by the order in the authorize and preacct sections.

realm IPASS {

format = prefix

delimiter = "/"

ignore_default = no

ignore_null = no

}

# ‘username@realm’

#

realm suffix {

format = suffix

delimiter = "@"

ignore_default = no

ignore_null = no

}

# ‘username%realm’

#

realm realmpercent {

format = suffix

delimiter = "%"

ignore_default = no

ignore_null = no

}

# ‘domain\user’

#

realm ntdomain {

format = prefix

delimiter = "\\"

ignore_default = no

ignore_null = no

}

1.3.10 简单值检查模块(checkval)

It can be used to check if an attribute value in the request matches a (possibly multi valued) attribute in the check items This can be used for example for caller-id authentication. For the module to run both the request attribute and the check items attribute must exist.

checkval {

# The attribute to look for in the request

# Request包中查找的属性名称

item-name = Calling-Station-Id

# The attribute to look for in check items. Can be multi valued

# Check 表中查找的属性名称

check-name = Calling-Station-Id

# The data type. Can be

# 数据类型的种类

# stringintegeripaddrdateabinaryoctets

data-type = string

# If set to yes and we dont find the item-name attribute in the

# request then we send back a reject

# 如果设置为yes,我们不在request包中查找属性名称直接发送reject.

# DEFAULT is no

#notfound-reject = no

}

1.3.11 从写属性模块(attr_rewrite)

从写任何包,在认证和计费时都很有用.在拿到包后,可以从写包里属性的内容.

#attr_rewrite sanecallerid {

# attribute = Called-Station-Id

# may be "packet" "reply" "proxy" "proxy_reply" or "config"

# searchin = packet

# searchfor = "[+ ]"

# replacewith = ""

# ignore_case = no

# new_attribute = no

# max_matches = 10

# ## If set to yes then the replace string will be appended to the original string

# append = no

#}

预处理radius请求模块(preprocess)

预处理Radius请求,在交付其他模块处理前. 包含这两个配置文件. 可以从写那些由一些NAS添加的很奇怪的属性.然后把这些属性转换到一个形态。参见第二章。

配置实例:

preprocess {

huntgroups = ${confdir}/huntgroups

hints = ${confdir}/hints

with_ascend_hack = no

ascend_channels_per_line = 23

with_ntdomain_hack = no

with_specialix_jetstream_hack = no

with_cisco_vsa_hack = no

}

用户文件模块(files)

files {

usersfile = ${confdir}/users

acctusersfile = ${confdir}/acct_users

preproxy_usersfile = ${confdir}/preproxy_users

compat = no

}

日志信息记录模块(detail)

将计费信息详细记录到文件上,按照设定时间,每隔一个时段生成一个新文件记录.

detail {

detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d

detailperm = 0600

#suppress {

# User-Password

#}

}

将认证信息详细记录到文件上,按照设定时间,每隔一个时段生成一个新文件记录.

detail auth_log {

detailfile = ${radacctdir}/%{Client-IP-Address}/auth-detail-%Y%m%d

This MUST be 0600 otherwise anyone can read

the users passwords!

detailperm = 0600

}

阅读(1623) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~