pam_permission 模块
用途
允许或禁止通过包含用户和/或组列表的可配置文件进行认证。
描述
pam_permission 模块是一个认证和帐户服务 PAM 模块,它使用访问控制表来确定是否允许或拒绝认证请求。 要用于控制列表的文件是通过模块选项配置的,如果未指定,那么缺省为 /etc/ftpusers 。
[+|-][@]<name>The optional first character controls whether to allow(+) or deny(-) the request for the user or group specified by <name>. If a '+' or '-' is not the first character in an entry, then the value of the found=<行动> module option determines the behavior.
以 "@" 符号开头的名称将条目指定为组。 否则,该条目将用作用户名。 找到的第一个与用户名或组条目匹配的项用于确定访问权。
将忽略条目中的所有空格。 可以使用 "#" 字符作为行中的第一个字符将注释添加到文件中。 每行只允许一个条目或注释,并且从文件顶部开始,一次按顺序处理一个条目。
Using the keyword "ALL" for <名> will match all users. 由于文件是按顺序解析的,因此使用 "ALL" 关键字应该保留给文件末尾,因为忽略它之后的任何条目。
Upon reaching the end of the access-control file, if a match to a user name or group has not been made, the result will be the opposite value of the found=<行动> module option. 例如,如果设置了 found=prohibit 并且在文件中找不到该用户,那么将允许该用户的结果。
如果指定的访问控制文件不存在,那么模块将返回 PAM_IGNORE 并且对模块堆栈没有影响。 不建议模块堆栈的整体成功或失败仅取决于 pam_permission。
#
# Provide /etc/ftpusers access-control
# to PAM-enabled ftp.
#
ftp auth requisite /usr/lib/security/pam_permission
file=/etc/ftpusers found=prohibit
ftp auth required /usr/lib/security/pam_aix
支持的 PAM 模块类型
- 认证
- 根据访问控制文件的内容提供用户认证。
- 帐户管理
- 根据访问控制文件中的规则提供帐户访问和拒绝。
选项
| 项 | 描述 |
|---|---|
| debug | 将调试信息记录到 syslog。 |
| nowarn | 不显示警告消息。 |
| file=<文件名> | 使用 <filename> 作为访问控制文件。 缺省为 /etc/ftpusers. 。 |
| found={allow | prohibit} | 如果条目匹配为 found ,但前面没有 "+" 或 "-"。 缺省值为 prohibit。 |
返回值
成功完成后,将返回 PAM_SUCCESS。 如果发生故障,将根据实际错误返回 PAM 错误代码。
位置
/usr/lib/security/pam_permission