solaris下将关机权限赋予普通用户.docVIP

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  5. 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  6. 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  7. 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  8. 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
solaris下将关机权限赋予普通用户

solaris下将关机权限赋予普通用户.txt38当乌云布满天空时,悲观的人看到的是“黑云压城城欲摧”,乐观的人看到的是“甲光向日金鳞开”。无论处在什么厄运中,只要保持乐观的心态,总能找到这样奇特的草莓。 1 建立一个关机角色,并设置密码: [root@node01 /]#roleadd –m –d /export/home/norshut norshut [root@node01 /]#passwd norshut 2 定义角色的权限配置(right profile): 这里要编辑/etc/security/prof_attr文件。 [root@node01 /]#echo shutdown:suser:::This role can execute shutdown/etc/security/prof_attr 3 定义权限配置的可用特权: 这里编辑/etc/security/exec_attr文件. [root@node01 /]#echo shutdown:suser:cmd:::/usr/sbin/shutdown:uid=0/etc/security/exec_attr 4 把权限配置和角色关联: [root@node01 /]# rolemod –P “shutdown” norshut 注:在创建新用户的同时可用指定-R参数直接指定新用户帐号的角色。 5 添加新用户并把角色赋予新用户: [root@node01 /]#useradd –g student –m –d /export/home/usrer01 –R norshut user01 [root@node01 /]#passwd user01 如果在添加新用户时没有使用-R参数可以使用下面的命令将角色赋予新用户: [root@node01 /]# usermod –R norshut user01 6 测试新角色: [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 //普通用户不能执行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 //查看当前的rights profiles能执行哪些命令 shutdown: /usr/sbin/shutdown uid=0

文档评论(0)

yan698698 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档