跳过导航链接 | |
退出打印视图 | |
手册页第 1 部分:用户命令 Oracle Solaris 11.1 Information Library (简体中文) |
- 管理和列出授权
auths [user]...
auths list [-S repository] [-v] [-u user]
auths info [-S repository] [-v] [authorization]
auths check [-u user] authorization
auths add [-S repository] -t description [-h help_file_path] authorization
auths modify [-S repository] [-t description] [-h help_file_path] authorization
auths remove [-S repository] authorization
auths 命令在标准输出上显示已授予您或者随意指定的用户或角色的授权。授权是某些特权程序在确定用户是否可以执行受限功能时要检查的权限。
此命令还可以在 auth_attr(4) 数据库中创建和修改授权及其属性(在本地文件名称服务或 LDAP 名称服务中)。auths 命令还在标准输出上显示已授予您或者随意指定的用户或角色的授权。
管理员必须具有 "Rights Management"(权限管理)配置文件才能使用添加、修改或删除子命令管理 auth_attr(4) 数据库中的授权。
每个用户可以具有零个或多个授权。授权由全限定名表示,该名称可标识创建授权的组织及其控制的功能。按照 Java 约定,授权的分层组件由句点 (.) 分隔,以创建组织的逆序 Internet 域名开头,以授权类中的特定函数结尾。授权不能以句点 (.) 结尾。
星号 (*) 表示类中的所有授权。
在 user_attr(4) 和 /etc/security/policy.conf 文件中查找用户的授权(请参见 policy.conf(4))。可在 user_attr(4) 中直接指定授权,或通过 prof_attr(4) 间接指定授权。也可以将授权作为缺省授权直接分配给系统中的每个用户,或者作为 /etc/security/policy.conf 文件中的缺省配置文件间接分配给每个用户。
在指定的名称服务系统信息库 (repository) 中创建指定的授权 (authorization)。
如果未指定系统信息库选项,则在文件名称服务中创建授权。
检查指定的授权 (authorization) 是否已授予指定的用户名 (user) 或当前用户。
如果用户具有相应的授权,则 auths 会以退出代码 0 退出。否则,该命令会返回大于 1 的退出代码。
检查指定的授权 (authorization) 是否存在于指定的名称服务系统信息库 (repository),或基于 nsswitch.conf(4)nsswitch.conf(4) 进行查找。如果指定的授权存在,则会列出该授权,且 auths 以返回代码 0 退出。
如果未指定授权,auths 会输出指定的名称服务系统信息库中存在的所有授权,或基于 nsswitch.conf(4) 输出所有授权。
列出分配给指定用户 (user) 或当前用户的所有授权,如果未指定用户名,则基于名称服务系统信息库 (repository) 列出所有授权。
如果未指定系统信息库,则基于 nsswitch.conf(4) 查找信息。
修改指定名称服务系统信息库中的现有授权。如果未指定系统信息库,则修改基于 nsswitch.conf(4) 找到的第一个名称服务中的授权。
在指定的名称服务系统信息库 (repository) 中删除现有授权 (authorization)。
如果未指定系统信息库,则从基于 nsswitch.conf(4) 找到的第一个名称服务中删除授权。
auths 子命令支持以下选项:
设置包含授权相关信息的帮助文件的位置。
指定要修改或搜索的名称服务系统信息库 (repository)。支持的系统信息库选项为 files 和 ldap。
如果省略此选项,将基于 nsswitch.conf(4) 进行查找。
指定授权的文本描述。
指定要列出或检查其授权的用户名 (user)。
如果省略此选项,将使用当前用户。
输出授权描述。
示例 1 使用 auths 命令
auths 的输出内容如下所示:
example% auths tester01 tester02 tester01 : solaris.system.date,solaris.jobs.admin tester02 : solaris.system.* example%
tester01 中的授权名称由逗号分隔,逗号后不加空格。
以下命令列出分配给用户 tester01 的授权。
example% auths list -u tester01 tester01: solaris.jobs.admin solaris.system.date
示例 2 列出授权
以下命令列出分配给用户 tester01 的授权及说明。
example% auths list -v -u tester01 tester01: solaris.jobs.admin Manage All Jobs solaris.system.date Set Date & Time
示例 3 列出授权
以下命令列出名称服务中的授权和描述。
example% auths info -v solaris.user.manage solaris.user.manage: Manage user accounts example%
示例 4 添加授权
以下命令将授权 solaris.foo.manage 以及描述 manage foo 和帮助文件 AuthFoo.html 添加到文件名称服务系统信息库中。
example% auths add -t "manage foo"\ -h /home/abc/AuthFoo.html solaris.foo.manage
示例 5 修改授权
以下示例在 LDAP 中修改授权 solaris.foo.manage,将描述设置为 manage foo and bar,将帮助文件设置为 AuthFooBar.html。
example% auths -S ldap modify -t " manage foo and bars"\ -h /home/abc/AuthFooBar.html solaris.foo.manage
将返回以下退出值:
成功完成。
出现错误。
用户未经授权。
/etc/user_attr
/etc/security/auth_attr
/etc/security/policy.conf
/etc/security/prof_attr
有关下列属性的说明,请参见 attributes(5):
|
profiles(1)、roles(1)、getauthattr(3C)、auth_attr(4)、policy.conf(4)、prof_attr(4)、user_attr(4)、attributes(5)