profiles-列出当前用户的权限配置文件
profiles -a-列出所有权限配置文件名称
profiles -l-列出当前用户的权限配置文件的完整定义
profiles username-列出 username 的权限配置文件
profiles -x username-列出 username 的需要验证的权限配置文件
profiles -p profile-name info-以优质打印方式输出指定权限配置文件的内容
getent prof_attr-列出命名服务中所有权限配置文件的完整定义
$ profiles -a
Console User
CUPS Administration
Desktop Removable Media User
...
VSCAN Management
WUSB Management
示例 6-5 列出权限配置文件数据库的内容
$ getent prof_attr | more All:::Execute any command as the user or role:help=RtAll.html Audit Configuration:::Configure Solaris Audit:auths=solaris.smf.value.audit; help=RtAuditCfg.html ... Zone Management:::Zones Virtual Application Environment Administration: help=RtZoneMngmnt.html Zone Security:::Zones Virtual Application Environment Security:auths=solaris.zone.*, solaris.auth.delegate;help=RtZoneSecurity.html ...示例 6-6 列出用户的缺省权限配置文件
列出权限配置文件。缺省情况下会将以下权限配置文件指定给所有用户。
$ profiles Basic Solaris User All示例 6-7 列出初始用户的权限配置文件
为初始用户指定了多个权限配置文件。
$ profiles Initial user System Administrator Audit Review ... CPU Power Management Basic Solaris User All
要显示指定给初始用户的配置文件的所有安全属性,请使用 –l 选项。
$ profiles -l Initial user | more
Initial user:
System Administrator
profiles=Install Service Management,Audit Review,Extended Accounting
Flow Management,Extended Accounting Net Management,Extended Accounting Process
Management,Extended Accounting Task Management,Printer Management,Cron Managem
ent,Device Management,File System Management,Log Management,Mail Management,
Maintenance and Repair,Media Catalog,Name Service Management,Network Management,
Project Management,RAD Management,Service Operator,Shadow Migration Monitor,So
Software Installation,System Configuration,User Management,ZFS Storage Management
/usr/sbin/gparted uid=0
Install Service Management
auths=solaris.autoinstall.service
profiles=Install Manifest Management,Install Profile Management,
Install Client Management
...
示例 6-8 列出指定的权限配置文件的内容
初始用户列出了由 "Audit Review"(审计查看)配置文件授予的权限。
$ profiles -l Audit Review solaris.audit.read /usr/sbin/auditreduce euid=0 /usr/sbin/auditstat privs=proc_audit /usr/sbin/praudit privs=file_dac_read示例 6-9 列出权限配置文件中命令的安全属性
profiles 命令的变体可用于查看未指定给您的权限配置文件中命令的安全属性。
首先,列出配置文件中的命令。
% profiles -p "Audit Review" info name=Audit Review desc=Review Solaris Auditing logs help=RtAuditReview.html cmd=/usr/sbin/auditreduce cmd=/usr/sbin/auditstat cmd=/usr/sbin/praudit
然后,列出配置文件中某一个命令的安全属性。
% profiles -p "Audit Review" "select cmd=/usr/sbin/praudit ; info; end;" select: command is read-only id=/usr/sbin/praudit privs=file_dac_read end: command is read-only示例 6-10 列出最近创建的权限配置文件的内容
–less 选项首先显示最近添加的权限配置文件。在您的站点创建或修改了权限配置文件时,profiles 命令的变体非常有用。以下输出显示了Example 4–1 中添加的配置文件的内容。一般用户可以运行此命令。
$ profiles -la | less
LegacyApp
/opt/legacy-app/bin/legacy-cmd
euid=0
OpenLDAP...