当前位置:文档之家› 配置模块详细说明文档

配置模块详细说明文档

Radiusd.conf文件配置Radiusd.conf文件是freeradius的核心配置文件,其中设置了服务器的基本信息,配置文件与日志文件的环境变量,并详细配置freeradius模块所使用的信息,与认证和计费所使用模块的配置. 配置的变量定义的形式为${foo},他们就在这个文件上,并且不随请求到请求而改变. 变量的格式参照variables.txt.此处定义其他配置文件以及目录的位置,也就是环境变量prefix = /usr/localexec_prefix = ${prefix}sysconfdir = ${prefix}/etclocalstatedir = ${prefix}/varsbindir = ${exec_prefix}/sbinlogdir = ${localstatedir}/log/radiusraddbdir = ${sysconfdir}/raddbradacctdir = ${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.piduser/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 ()# 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 = noexpressions支持,规则和扩展.regular_expressions = yesextended_expressions = yes记录User-Name属性的全称.log_stripped_names = no是否记录认证请求信息到日志文件log_auth = no当请求被拒绝时记录密码,当请求正确时记录密码log_auth_badpass = nolog_auth_goodpass = no是否允许用户名冲突,即重复同用户同时登陆.强烈不建议启用重复用户. usercollide = no将用户名小写化,将密码小写化.lower_user = nolower_pass = no是否去除用户名和密码中的空格nospace_user = nonospace_pass = no程序执行并发检查(不理解含义)checkrad = ${sbindir}/checkrad安全配置域security {指在Radius包中的最大属性数目.设置为0表示无穷大.max_attributes = 200发送Access-Reject 包时候,可以设置一定的延迟,以缓慢DOS攻击,也可以缓慢穷举破解用户名和密码的攻击reject_delay = 1服务器是否对状态服务器的请求信息进行相应.status_server = no}PROXY CONFIGURATION代理域.是否开启代理服务,具体配置参照${confdir}/proxy.confproxy_requests = yes$INCLUDE ${confdir}/proxy.confClients配置$INCLUDE ${confdir}/clients.conf是否启用snmp配置,具体配置文件在snmp.confsnmp = no$INCLUDE ${confdir}/snmp.conf线程池配置域thread pool {启动时服务的个数.(在启动Mysql模块后可以明显看到.)当同时进行的请求数超过5个时,会增加线程服务.start_servers = 5最大的服务数max_servers = 32当少于最少空闲服务时,它会建立服务,大于最大空闲服务时会停止多余的服务.最少空闲服务,与最大空闲服务.min_spare_servers = 3max_spare_servers = 10每个server最大的请求数.当有内存漏洞时,可能需要配置.max_requests_per_server = 0}1.3 模块配置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 = nocache_reload = 600# passwd = /etc/passwd# shadow = /etc/shadow# group = /etc/groupradwtmp = ${logdir}/radwtmp}1.3.5 EAP模块详细见${confdir}/eap.conf$INCLUDE ${confdir}/eap.conf1.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 = prefixdelimiter = "/"ignore_default = noignore_null = no}# ‘username@realm’#realm suffix {format = suffixdelimiter = "@"ignore_default = noignore_null = no}# ‘username%realm’#realm realmpercent {format = suffixdelimiter = "%"ignore_default = noignore_null = no}# ‘domain\user’#realm ntdomain {format = prefixdelimiter = "\\"ignore_default = noignore_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# 数据类型的种类# string,integer,ipaddr,date,abinary,octetsdata-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#}1.3.12 预处理radius请求模块(preprocess)预处理Radius请求,在交付其他模块处理前. 包含这两个配置文件. 可以从写那些由一些NAS添加的很奇怪的属性.然后把这些属性转换到一个形态。

相关主题