亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3362 | 回復(fù): 0
打印 上一主題 下一主題

solaris下將關(guān)機(jī)權(quán)限賦予普通用戶 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2009-11-29 13:27 |只看該作者 |倒序瀏覽

這里使用的是solaris10的RBAC,也可以使用sudo實(shí)現(xiàn),下面是RBAC的實(shí)例:
建立一個關(guān)機(jī)角色,并設(shè)置密碼:
[root@node01 /]#roleadd –m –d /export/home/norshut norshut
[root@node01 /]#passwd norshut
定義角色的權(quán)限配置(right profile):
這里要編輯/etc/security/prof_attr文件。
[root@node01 /]#echo "shutdown:suser:::This role can execute shutdown">>/etc/security/prof_attr
定義權(quán)限配置的可用特權(quán):
這里編輯/etc/security/exec_attr文件.
[root@node01 /]#echo "shutdown:suser:cmd:::/usr/sbin/shutdown:uid=0">>/etc/security/exec_attr
  把權(quán)限配置和角色關(guān)聯(lián):
[root@node01 /]# rolemod –P “shutdown” norshut
注:在創(chuàng)建新用戶的同時可用指定-R參數(shù)直接指定新用戶帳號的角色。
添加新用戶并把角色賦予新用戶:
[root@node01 /]#useradd –g student –m –d /export/home/usrer01 –R norshut user01
[root@node01 /]#passwd user01
如果在添加新用戶時沒有使用-R參數(shù)可以使用下面的命令將角色賦予新用戶:
[root@node01 /]# usermod –R norshut user01
測試新角色:
[root@node01 /]# su - user01
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
-bash-3.00$ cat /etc/user_attr
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# /etc/user_attr
#
# execution attributes for profiles. see user_attr(4)
#
#ident  "@(#)user_attr  1.1     07/01/31 SMI"
#
#
adm::::profiles=Log Management
lp::::profiles=Printer Management
postgres::::type=role;profiles=Postgres Administration,All
root::::auths=solaris.*,solaris.grant;profiles=Web Console Management,All;lock_after_retries=no;min_label=admin_low;clearance=admin_high
shutadmin::::type=role;profiles=shutdown
user01::::type=normal;roles=norshut
這個文件會多出如上斜體部分.
-bash-3.00$ profiles
Basic Solaris User
All
-bash-3.00$ roles
norshut
-bash-3.00$ /usr/sbin/shutdown
/usr/sbin/shutdown:  Only root can run /usr/sbin/shutdown   //普通用戶不能執(zhí)行shutdown命令
-bash-3.00$ su – norshut      //切換到norshut角色
Password:
$ id
uid=100(norshut) gid=1(other)
$ /usr/ucb/whoami
norshut
$ profiles           //查看norshut有哪些rights profile
shutdown
Basic Solaris User
All
$ profiles –l        //查看當(dāng)前的rights profiles能執(zhí)行哪些命令
      shutdown:
          /usr/sbin/shutdown    uid=0
      All:
          *   
$ /usr/sbin/shutdown -y -g0 -i5
Shutdown started.    Fri Nov 27 21:25:02 CST 2009
Changing to init state 5 - please wait
Broadcast Message from root (pts/2) on node01 Fri Nov 27 21:25:02...
THE SYSTEM node01 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged


本文來自ChinaUnix博客,如果查看原文請點(diǎn):http://blog.chinaunix.net/u1/36549/showart_2106698.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP