JavaScript is required to for searching.
跳过导航链接
退出打印视图
手册页第 1 部分:用户命令     Oracle Solaris 11.1 Information Library (简体中文)
为本文档评分
search filter icon
search icon

文档信息

前言

简介

User Commands

acctcom(1)

adb(1)

addbib(1)

admin(1)

alias(1)

allocate(1)

amt(1)

appcert(1)

apptrace(1)

apropos(1)

ar(1)

arch(1)

as(1)

asa(1)

at(1)

atq(1)

atrm(1)

audioconvert(1)

audioctl(1)

audioplay(1)

audiorecord(1)

audiotest(1)

auths(1)

auto_ef(1)

awk(1)

banner(1)

basename(1)

basename(1B)

batch(1)

bc(1)

bdiff(1)

bfs(1)

bg(1)

biff(1B)

break(1)

builtin(1)

cal(1)

calendar(1)

case(1)

cat(1)

cd(1)

cdc(1)

cdrw(1)

chdir(1)

checkeq(1)

checknr(1)

chgrp(1)

chkey(1)

chmod(1)

chown(1)

chown(1B)

ckdate(1)

ckgid(1)

ckint(1)

ckitem(1)

ckkeywd(1)

ckpath(1)

ckrange(1)

ckstr(1)

cksum(1)

cktime(1)

ckuid(1)

ckyorn(1)

clear(1)

cmp(1)

col(1)

comb(1)

comm(1)

command(1)

compress(1)

continue(1)

cp(1)

cpio(1)

cpp(1)

cputrack(1)

crle(1)

crontab(1)

csh(1)

csplit(1)

ct(1C)

ctags(1)

ctrun(1)

ctstat(1)

ctwatch(1)

cu(1C)

cut(1)

date(1)

dc(1)

deallocate(1)

decrypt(1)

delta(1)

deroff(1)

df(1B)

dhcpinfo(1)

diff(1)

diff3(1)

diffmk(1)

digest(1)

digestp(1)

dircmp(1)

dirname(1)

dirs(1)

dis(1)

disown(1)

dispgid(1)

dispuid(1)

dos2unix(1)

dpost(1)

du(1)

du(1B)

dump(1)

dumpcs(1)

dumpkeys(1)

echo(1)

echo(1B)

ed(1)

edit(1)

egrep(1)

eject(1)

elfdump(1)

elfedit(1)

elffile(1)

elfsign(1)

elfwrap(1)

encrypt(1)

enhance(1)

env(1)

eqn(1)

errange(1)

errdate(1)

errgid(1)

errint(1)

erritem(1)

error(1)

errpath(1)

errstr(1)

errtime(1)

erruid(1)

erryorn(1)

eval(1)

ex(1)

exec(1)

exit(1)

expand(1)

export(1)

exportfs(1B)

expr(1)

expr(1B)

exstr(1)

factor(1)

false(1)

fastboot(1B)

fasthalt(1B)

fc(1)

fg(1)

fgrep(1)

file(1)

file(1B)

filebench(1)

filep(1)

filesync(1)

filofaxp(1)

find(1)

finger(1)

fmt(1)

fmtmsg(1)

fold(1)

for(1)

foreach(1)

franklinp(1)

from(1B)

ftp(1)

function(1)

gcore(1)

gencat(1)

geniconvtbl(1)

genmsg(1)

get(1)

getconf(1)

getfacl(1)

getlabel(1)

getopt(1)

getoptcvt(1)

getopts(1)

gettext(1)

gettxt(1)

getzonepath(1)

glob(1)

goto(1)

gprof(1)

grep(1)

groups(1)

groups(1B)

grpck(1B)

hash(1)

hashcheck(1)

hashmake(1)

hashstat(1)

head(1)

helpdate(1)

helpgid(1)

helpint(1)

helpitem(1)

helppath(1)

helprange(1)

helpstr(1)

helptime(1)

helpuid(1)

helpyorn(1)

hist(1)

history(1)

hostid(1)

hostname(1)

i386(1)

i486(1)

iconv(1)

if(1)

indxbib(1)

install(1B)

ipcrm(1)

ipcs(1)

isainfo(1)

isalist(1)

jobs(1)

join(1)

jsh(1)

kbd(1)

kdestroy(1)

keylogin(1)

keylogout(1)

kill(1)

kinit(1)

klist(1)

kmdb(1)

kmfcfg(1)

kpasswd(1)

krb5-config(1)

ksh(1)

ksh88(1)

ksh93(1)

ktutil(1)

kvno(1)

lari(1)

last(1)

lastcomm(1)

ld(1)

ldapadd(1)

ldapdelete(1)

ldaplist(1)

ldapmodify(1)

ldapmodrdn(1)

ldapsearch(1)

ldd(1)

ld.so.1(1)

let(1)

lex(1)

lgrpinfo(1)

limit(1)

line(1)

list_devices(1)

listusers(1)

llc2_autoconfig(1)

llc2_config(1)

llc2_stats(1)

ln(1)

ln(1B)

loadkeys(1)

locale(1)

localedef(1)

logger(1)

logger(1B)

login(1)

logname(1)

logout(1)

look(1)

lookbib(1)

lorder(1)

ls(1)

ls(1B)

m4(1)

mac(1)

mach(1)

machid(1)

madv.so.1(1)

mail(1)

Mail(1B)

mail(1B)

mailcompat(1)

mailp(1)

mailq(1)

mailstats(1)

mailx(1)

make(1S)

makekey(1)

man(1)

mconnect(1)

mcs(1)

mdb(1)

mesg(1)

mkdir(1)

mkmsgs(1)

mkstr(1B)

mktemp(1)

moe(1)

more(1)

mp(1)

mpss.so.1(1)

msgcc(1)

msgcpp(1)

msgcvt(1)

msgfmt(1)

msggen(1)

msgget(1)

mt(1)

mv(1)

nawk(1)

nc(1)

ncab2clf(1)

ncakmod(1)

neqn(1)

netcat(1)

newform(1)

newgrp(1)

newsp(1)

newtask(1)

nice(1)

nl(1)

nm(1)

nohup(1)

notify(1)

nroff(1)

od(1)

on(1)

onintr(1)

optisa(1)

pack(1)

packagemanager(1)

page(1)

pagesize(1)

pargs(1)

passwd(1)

paste(1)

patch(1)

pathchk(1)

pax(1)

pcat(1)

pcred(1)

perl(1)

pfbash(1)

pfcsh(1)

pfexec(1)

pfiles(1)

pfksh(1)

pflags(1)

pfsh(1)

pftcsh(1)

pfzsh(1)

pg(1)

pgrep(1)

pkcs11_inspect(1)

pkg(1)

pkgdepend(1)

pkgdiff(1)

pkgfmt(1)

pkginfo(1)

pkglint(1)

pkgmerge(1)

pkgmk(1)

pkgmogrify(1)

pkgparam(1)

pkgproto(1)

pkgrecv(1)

pkgrepo(1)

pkgsend(1)

pkgsign(1)

pkgtrans(1)

pkill(1)

pklogin_finder(1)

pktool(1)

plabel(1)

pldd(1)

plgrp(1)

plimit(1)

pmadvise(1)

pmap(1)

pm-updatemanager(1)

popd(1)

ppgsz(1)

ppriv(1)

pr(1)

praliases(1)

prctl(1)

preap(1)

print(1)

printenv(1B)

printf(1)

priocntl(1)

proc(1)

prof(1)

profiles(1)

projects(1)

prs(1)

prt(1)

prun(1)

ps(1)

ps(1B)

psig(1)

pstack(1)

pstop(1)

ptime(1)

ptree(1)

pushd(1)

pvs(1)

pwait(1)

pwd(1)

pwdx(1)

radadrgen(1)

ranlib(1)

rcapstat(1)

rcp(1)

read(1)

readonly(1)

red(1)

refer(1)

regcmp(1)

rehash(1)

remote_shell(1)

remsh(1)

renice(1)

repeat(1)

reset(1B)

return(1)

rksh(1)

rksh88(1)

rlogin(1)

rm(1)

rmail(1)

rmdel(1)

rmdir(1)

rmformat(1)

rmmount(1)

rmumount(1)

roffbib(1)

roles(1)

rpcgen(1)

rpm2cpio(1)

rsh(1)

runat(1)

rup(1)

rup(1C)

ruptime(1)

rusage(1B)

rusers(1)

rwho(1)

sact(1)

sar(1)

sccs(1)

sccs-admin(1)

sccs-cdc(1)

sccs-comb(1)

sccs-delta(1)

sccsdiff(1)

sccs-get(1)

sccs-help(1)

sccshelp(1)

sccs-prs(1)

sccs-prt(1)

sccs-rmdel(1)

sccs-sact(1)

sccs-sccsdiff(1)

sccs-unget(1)

sccs-val(1)

scp(1)

script(1)

sdiff(1)

sed(1)

sed(1B)

select(1)

set(1)

setenv(1)

setfacl(1)

setlabel(1)

setpgrp(1)

settime(1)

sftp(1)

sh(1)

shcomp(1)

shell_builtins(1)

shift(1)

shutdown(1B)

size(1)

sleep(1)

soelim(1)

sort(1)

sortbib(1)

sotruss(1)

source(1)

sparc(1)

spell(1)

spellin(1)

split(1)

srchtxt(1)

ssh(1)

ssh-add(1)

ssh-agent(1)

ssh-http-proxy-connect(1)

ssh-keygen(1)

ssh-keyscan(1)

ssh-socks5-proxy-connect(1)

stop(1)

strchg(1)

strconf(1)

strings(1)

strip(1)

stty(1)

stty(1B)

sum(1)

sum(1B)

sun(1)

suspend(1)

svcprop(1)

svcs(1)

switch(1)

symorder(1)

sys-suspend(1)

sysV-make(1)

t300(1)

t300s(1)

t4014(1)

t450(1)

tabs(1)

tail(1)

talk(1)

tar(1)

tbl(1)

tcopy(1)

tee(1)

tek(1)

telnet(1)

test(1)

test(1B)

tftp(1)

time(1)

timemanp(1)

times(1)

timesysp(1)

timex(1)

tip(1)

touch(1)

touch(1B)

tplot(1)

tput(1)

tr(1)

tr(1B)

trap(1)

troff(1)

true(1)

truss(1)

tset(1B)

tsort(1)

tty(1)

type(1)

typeset(1)

ul(1)

ulimit(1)

umask(1)

unalias(1)

uname(1)

uncompress(1)

unexpand(1)

unget(1)

unhash(1)

unifdef(1)

uniq(1)

units(1)

unix2dos(1)

unlimit(1)

unpack(1)

unset(1)

unsetenv(1)

until(1)

updatehome(1)

uptime(1)

userattr(1)

users(1B)

uucp(1C)

uudecode(1C)

uuencode(1C)

uuglist(1C)

uulog(1C)

uuname(1C)

uupick(1C)

uustat(1C)

uuto(1C)

uux(1C)

vacation(1)

val(1)

valdate(1)

valgid(1)

valint(1)

valpath(1)

valrange(1)

valstr(1)

valtime(1)

valuid(1)

valyorn(1)

vc(1)

vedit(1)

ver(1)

vgrind(1)

vi(1)

view(1)

vipw(1B)

volcheck(1)

volrmmount(1)

w(1)

wait(1)

wc(1)

what(1)

whatis(1)

whence(1)

whereis(1B)

which(1)

while(1)

who(1)

whoami(1B)

whocalls(1)

whois(1)

write(1)

xargs(1)

xgettext(1)

xstr(1)

yacc(1)

yes(1)

ypcat(1)

ypmatch(1)

yppasswd(1)

ypwhich(1)

zcat(1)

zlogin(1)

zonename(1)

zonestat(1)

请告诉我们如何提高我们的文档:
过于简略
不易阅读或难以理解
重要信息缺失
错误的内容
需要翻译的版本
其他
Your rating has been updated
感谢您的反馈!

您的反馈将非常有助于我们提供更好的文档。 您是否愿意参与我们的内容改进并提供进一步的意见?

profiles

- 列出和管理权限配置文件

用法概要

profiles [-l] [-a | user ...] [-S repository]
profiles -p profiles [-S repository]
profiles -p profiles [-S repository] subcommand
profiles -p profiles [-S repository] -f command_file
profiles help

描述

profiles 实用程序在本地文件名称服务或 LDAP 名称服务中的 prof_attr(4)exec_attr(4) 数据库中创建和修改权限配置文件的配置。一个权限配置文件配置由一个配置文件名称和多个属性组成。

profiles 子命令的以下概要适用于交互式用法:

profiles -p profile [-S repository] [subcommand]

profiles 命令在标准输出上输出已分配给您(或可选择指定的用户或角色名)的权限配置文件的名称。配置文件是用于枚举执行特定函数所需的命令和授权的一种绑定机制。如果进程是由特权命令解释程序启动的,则随每个可执行程序一起列出的还有进程运行时使用的进程属性,例如有效的用户和组 ID。请参见 pfexec(1) 手册页。配置文件可以包含 prof_attr(4) 中定义的其他配置文件。

可以组合多个配置文件来构造合适的访问控制。分配配置文件时,授权将添加到现有的集合中。如果同一命令出现在多个配置文件中,则将第一次出现(根据配置文件的顺序确定)的命令用于进程属性设置。为方便起见,可指定一个通配符以匹配所有命令。

特殊配置文件 "Stop"(停止)会截断对后续配置文件的评估。将不会对位于 "Stop"(停止)配置文件后的配置文件进行评估,也不会使用它们来查找其他命令。该配置文件可用来绕过 /etc/security/policy.conf 中以 PROF_GRANTED 键列出的配置文件和以 AUTH_GRANTED 键列出的授权。

解释配置文件时,将从 user_attr(4) 装入配置文件列表。如果在 /etc/security/policy.conf 中定义了任何缺省配置文件(请参见 policy.conf(4)),则缺省配置文件的列表将添加到从 user_attr(4)装入的列表中。prof_attr(4) 中的匹配项提供了授权列表,exec_attr(4) 中的匹配项提供了命令列表。

属性

使用 -p 选项调用时,可以管理指定配置文件的属性及其相关联的可执行文件的属性。不过,为维护系统完整性,此命令不能修改由 Solaris 维护的那些配置文件。这类配置文件只能在系统更新期间通过 pkg(1) 命令进行修改。

另外,还可通过 pkg(1) 命令将其他配置文件声明为不可修改的。

为防止特权升级,可根据用户的授权来限制属性值。至少要授予管理员 "Rights Management"(权限管理)配置文件。此外,要修改由委托授权控制的安全相关属性,必须向管理员授予 "Rights Delegation"(权限委托)配置文件。有关详细信息,请参见 exec_attr(4)prof_attr(4) 及以下摘要。

属性值可以是简单字符串,也可以是简单字符串的逗号分隔列表。包含空格的简单字符串必须括在双引号中。

profiles 命令在 profile 上下文和 command 上下文中运行。profile 上下文是初始状态,在此状态下,可管理各种配置文件属性。下表概述了 profile 上下文中的属性:

Property Name   Value Type         Required Authorizations

name            simple             none
auths           list of simple     solaris.auth.{assign/delegate}
profiles        list of simple     solaris.profile.{assign/delegate}
privs           list of simple     solaris.privilege.{assign/delegate}
limitpriv       list of simple     solaris.privilege.{assign/delegate}
defaultpriv     list of simple     solaris.privilege.{assign/delegate}
always_audit    list of simple     solaris.audit.assign
never_audit     list of simple     solaris.audit.assign
desc            simple             none
help            simple             none
pam_policy      simple             solaris.account.setpolicy
cmd             simple/new context none

通过指定 cmd 属性可进入 command 上下文。在 command 上下文中,可管理当前命令的属性。

下表概述了 command 上下文中的属性:

Property Name   Value Type         Required Authorizations

id              simple             none
privs           list of simple     solaris.privilege.{assign/delegate}
limitprivs      list of simple     solaris.privilege.{assign/delegate}
euid            simple             solaris.profile.cmd.setuid
uid             simple             solaris.profile.cmd.setuid
egid            simple             solaris.group.{assign/delegate}
gid             simple             solaris.group.{assign/deleg

以下列表介绍了可在 profile 上下文属性中指定的值。如以下列表中所指定,在属性与属性值之间需要有一个等号 (=)。

always_audit

用来将事件类指定为始终审计的审计标志。在登录和执行 su 命令时,只会应用该属性的第一个实例(在用户的 user_attr(4) 条目中或者在所分配的配置文件的有序列表中)。

auths

要添加到新配置文件中的一个或多个以逗号分隔的授权。如果在授权名称中使用了通配符 (*),则名称必须括在双引号 (") 中。

cmd

可执行文件的全限定路径或星号 (*),后者用于指定所有命令。替换路径名中文件名组件的星号用于指示某个特定目录中的所有文件。

这是一个特殊属性,用于进入 command 上下文以管理命令的安全属性。

可以将数字 ID 或名称用于这些 ID。

id

此属性初始设置为由前面的 cmd 属性指定的值,但是可以修改。与 select 子命令一起使用时,可以克隆现有命令的属性以进行后续编辑。

pam_policy

要应用于用户的 PAM 策略。pam_policy 必须是 pam.conf(4) 格式文件的绝对路径名,或者是位于 /etc/security/pam_policypam.conf(4) 格式文件的文件名。有关更多信息,请参见 pam_user_policy(5)

privs

应用于可执行进程的可继承集的特权集。缺省值为 basic。

limitprivs

应用于可执行进程的限制集的特权集。缺省值为 all。

euid

通过该命令执行的进程的有效用户 ID。

uid

通过该命令执行的进程的实际用户 ID。

egid

通过该命令执行的进程的有效组 ID。

gid

通过该命令执行的进程的实际组 ID。

defaultpriv

分配给用户的进程集的缺省特权集。在登录和执行 su 命令时,只会应用该属性的第一个实例(在用户的 user_attr(4) 条目中或者在所分配的配置文件的有序列表中)。

desc

新配置文件的说明。文本必须括在引号中。

help

新配置文件的帮助文件名称。帮助文件将被复制到 /usr/lib/help/profiles/locale/<locale> 目录中。其中,<locale> 是用户的语言环境的值,如果未指定任何内容,则为 C。只有在文件系统信息库中才适合指定此属性。

limitpriv

用户或者由用户启动的任何进程(不管是通过 su(1M) 还是以任何其他方式)可以获得的最大特权集。在登录和执行 su 命令时,只会应用该属性的第一个实例(在用户的 user_attr(4) 条目中或者在所分配的配置文件的有序列表中)。

name

配置文件的名称。名称的初始值是在命令行中使用 -p 选项指定的。如果名称发生更改,当前的配置文件属性将应用于新命名的配置文件。通过这种方式,可以克隆现有的配置文件以进行后续编辑。名称不得与某个现有的配置文件相同。

never_audit

用来将事件类指定为从不审计的审计标志。在登录和执行 su 命令时,只会应用该属性的第一个实例(在用户的 user_attr(4) 条目中或者在所分配的配置文件的有序列表中)。

privs

可使用 pfexec(1) 命令的 P 选项指定的特权集。

配置文件

要添加到新配置文件中的一个或多个以逗号分隔的辅助配置文件。

选项

支持以下选项:

-a

列出指定的系统信息库中的所有配置文件名称。如果未指定系统信息库,它将显示在 nsswitch.conf(4) 中为 prof_attr 配置的任何配置文件。

-f command_file

指定 profiles 命令文件的名称。command_file 是包含 profiles 的子命令的文本文件,一行一个。

-l

提供有关权限配置文件的信息,并列出命令及其特殊进程属性,如用户和组 ID

-p profile

指定配置文件名称。

-S repository

有效的系统信息库为 filesldaprepository 指定要更新的名称服务。缺省 repository 为文件。

子命令

使用 -p 选项调用时,可在命令行中或以交互方式提供子命令。可在命令行上指定以分号分隔的多个子命令,并且需要将整个子命令集括在引号中。未提供子命令意味着交互式会话,在此会话期间,可通过使用 TAB 键调用子命令的自动完成。

可使用 addselect 子命令选择一个特定的命令,从而使上下文更改为该命令的上下文。在交互式会话期间,command 上下文由提示字符串中的命令基名标识。可使用 endcancel 子命令结束命令指定,从而将上下文恢复为 profile 上下文。

可导致破坏性操作或导致工作丢失的子命令具有一个强制执行操作的 -F 选项。如果输入来自终端设备,系统会在适当的时候提示用户。如果指定子命令时没有使用 -F 选项,这就有可能发生。其他情况下,不允许执行操作,并向标准错误写入一条诊断消息。

属性值可以是一个简单值,对于接受列表的属性来说,则是简单值的列表。支持以下子命令:

add cmd=pathname

profile 上下文中,开始指定给定的命令。上下文将更改为 command 类型。

add property-name=property-value

将指定值添加到当前属性值。此子命令仅可应用于接受列表的属性。

cancel

结束命令指定,并将上下文重新设置为 profile。放弃任何部分指定的资源。cancel 仅适用于 command 上下文。

clear property name

清除属性的值。

commit

将当前配置从内存提交到稳定存储器。必须提交配置才能使更改生效。在提交内存中的配置之前,可以使用 revert 子命令删除更改。在 profiles 会话完成时,会自动尝试 commit 操作。因为配置必须是正确的才能提交,因此该操作将自动执行 verify

delete [-F]

从内存和稳定存储器中删除指定的配置文件。如果该配置文件是同一系统信息库中另一个配置文件的子配置文件,则不允许此操作。但是会提供包含该配置文件的配置文件的列表,用户可在删除该配置文件之前手动将其移除。使用 -F 选项强制执行操作:如果允许删除,其操作是即时的,会话将终止。

end

结束命令指定。此子命令仅适用于 command 上下文。profiles 命令验证是否完整指定了当前命令。如果是,当前命令将添加到内存中的配置(有关将其保存到稳定存储器的信息,请参见 commit),且上下文将恢复为 profile 上下文。如果指定不完整,它将发出相应的错误消息。

exit [-F]

退出 profiles 会话。如果需要,会自动尝试 commit。还可使用 EOF 字符退出 profiles。可使用 -F 选项强制执行操作。

export [-f output-fle]

将配置输出至标准输出。使用 -f 选项可将配置输出至输出文件。此选项以适合在命令文件选项中使用的格式生成输出。

help [usage] [subcommands] [properties] [<subcommand.] [<properties>]

输出常规帮助或有关特定主题的帮助。

info [property-name]

显示有关当前配置文件或指定属性的信息。

remove cmd=fullpath

从配置文件中删除指定的命令。此子命令仅在 profile 上下文中有效。

remove [-F] cmd

从配置文件中删除所有命令。如果未使用 -F 选项,则需要确认。此子命令仅在 profile 上下文中有效。

remove property-name=property-value

从属性中删除指定的值。这仅可应用于接受列表的属性。

revert [-F]

将配置恢复到上次提交时的状态。可使用 -F 选项强制执行操作。

select cmd=fullpath

选择与给定路径名标准相匹配的命令以进行修改。此子命令仅适用于 profile 上下文。

set property-name=property-value

将给定属性名称设置为给定值。某些属性(如 namedesc)仅在 profile 上下文中有效,而某些属性则仅在 command 上下文中有效。此子命令同时适用于 profilecommand 上下文。

verify

检验当前配置是否正确:

  • 是否指定了必需的属性。

  • 各个值是否对每个关键字都有效。

  • 用户是否有权指定这些值。

示例

示例 1 使用 profiles 命令

profiles 命令的输出具有以下格式:

example% profiles tester01 tester02
tester01 : Audit Management, All Commands
tester02 : Device Management, All Commands
example%

示例 2 使用 list 选项

example% profiles -l tester01 tester02
tester01 :
    Audit Management:
      /usr/sbin/audit          euid=root
      /usr/sbin/auditconfig    euid=root    egid=sys
    All Commands:
      *
tester02 :
    Device Management:
      /usr/bin/allocate:       euid=root
      /usr/bin/deallocate:     euid=root
    All Commands
      *
example%

示例 3 创建新的配置文件

以下示例在 LDAP 中创建了一个新的 User Manager 配置文件。新配置文件的说明是 "Manage users and groups",分配的授权是 solaris.user.manage。分配的辅助配置文件是 Mail Management。帮助文件名是 RtUserMgmt.html

example% profiles -p "User Manager" -S ldap
profiles:User Manager> set desc="Manage users and groups"
profiles:User Manager> set help=RtUserMgmt.html
profiles:User Manager> set auths=solaris.user.manage
profiles:User Manager> set profiles="Mail Management"
profiles:User Manager> exit

示例 4 显示有关当前配置的信息

以下命令显示有关 User Manager 配置文件的信息:

example% profiles -p "User Manager" -S ldap info
name=User Manager
desc=Manage users and  groups
auths=solaris.user.manage
profiles=Mail Management
help=RtUserMgmt.html

示例 5 删除配置文件

以下命令从 LDAP 中删除 User Manager 配置文件:

example% profiles -p "User Manager" -S ldap delete -F

示例 6 修改配置文件

以下示例修改 LDAP 中的 User Manager 配置文件。新配置文件的说明是 "Manage world",新的授权分配是 solaris.user.* 授权,新的辅助配置文件分配是 All

example% profiles -p "User Manager" -S ldap
profiles:User Manager> set desc="Manage world"
profiles:User Manager> set auths="solaris.user.*"
profiles:User Manager> set profiles=All
profiles:User Manager> exit

示例 7 创建 exec_attr 数据库条目

以下命令为 LDAP 中的 User Manager 配置文件创建一个新的 exec_attr 条目。将添加 /usr/bin/cp 条目。此命令的有效用户 ID 为 0,有效组 ID 为 0

example% profiles -p "User Manager" -S ldap
profiles:User Manager> add cmd=/usr/bin/cp
profiles:User Manager:cp> set euid=0
profiles:User Manager:cp> set egid=0
profiles:User Manager:cp> end
profiles:User Manager> exit
example%

示例 8 删除 exec_attr 数据库条目

以下示例将从 LDAP 中的 User Manager 配置文件删除一个 exec_attr 数据库条目。将删除为命令 /usr/bin/cp 指定的条目。

example% profiles -p "User Manager" -S ldap
profiles:User Manager> remove cmd=/usr/bin/cp
profiles:User Manager> exit
example%

示例 9 修改 exec_attr 数据库条目

以下命令为 LDAP 中的 User Manager 配置文件修改 exec_attr 数据库条目的属性。将 /usr/bin/cp 条目修改为以实际用户 ID 0 和实际组 ID 0 执行。

example% profiles -p "User Manager" -S ldap
profiles:User Manager> select cmd=/usr/bin/cp
profiles:User Manager:cp> clear euid
profiles:User Manager:cp> clear egid
profiles:User Manager:cp> set uid=0
profiles:User Manager:cp> set gid=0
profiles:User Manager:cp> end
profiles:User Manager> exit
example%

退出状态

将返回以下退出值:

0

成功完成。

1

出现错误。

文件

/etc/security/exec_attr

/etc/security/prof_attr

/etc/user_attr

/etc/security/policy.conf

属性

有关下列属性的说明,请参见 attributes(5)

属性类型
属性值
可用性
system/core-os

另请参见

auths(1)pfexec(1)pkg(1)、roles(1)getprofattr(3C)auth_attr(4)exec_attr(4)nsswitch.conf(4)pam.conf(4)policy.conf(4)prof_attr(4)user_attr(4)audit_flags(5)attributes(5)pam_user_policy(5)privileges(5)