Chinaunix首页 | 论坛 | 博客
  • 博客访问: 58709
  • 博文数量: 22
  • 博客积分: 45
  • 博客等级: 民兵
  • 技术积分: 230
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-16 16:44
文章分类

全部博文(22)

文章存档

2014年(14)

2012年(1)

我的朋友

分类: 服务器与存储

2014-05-20 20:25:17

-- AIX
mkgroup -'A' id='700' adms='root' testg1
mkgroup -'A' id='701' adms='root' testg2
mkgroup -'A' id='702' adms='root' testg3
mkuser id='700' pgrp='testg1' groups='testg2,testg3' home='/home/testu1' testu1

man mkgroup
......
Flags

       -a
            Creates an administrative group. Only the root user can use this flag.
       -A
            Sets the group administrator to the person who invoked the mkgroup command.
       -R load_module
            Specifies the loadable I&A module used to create the user.
       Attribute=Value
            Initializes a group with a specific attribute. See the chgroup command for more 

information about the group attributes.
......
man mkuser
......
Flags

       -a
            Specifies that the user is an administrator. Only the root user can use this flag or alter 

the attributes of an administrative user.
       -R load_module
            Specifies the loadable I&A module used to create the user.
......


--hp
groupadd -g 700 testg1
groupadd -g 701 testg2
groupadd -g 702 testg3
useradd -g testg1 -G testg2,testg3 -u 700 -m -d /home/testu1 testu1



--redhatlinux
groupadd -g 700 testg1
groupadd -g 701 testg2
groupadd -g 702 testg3
useradd -g testg1 -G testg2,testg3 -u 700 -m -d /home/testu1 testu1



初始群组:/etc/passwd中用户对应的GID,当用户登录系统,立刻主动该用户群组的相关权限,
在/etc/group中第四栏初始群组不会存在该用户
有效群组:用groups命令输出的第一个组


小组切换
若需要/etc/groups记录(HP,LINUX)
useradd -g testg1 -G testg2,testg3 -u 700 -m -d /home/testu1 testu1 
方式在/etc/groups中testg1中无记录,切换小组后,testu1自动失去testg1群组的相关权限
 
useradd -g testg1 -G testg1,testg2,testg3 -u 700 -m -d /home/testu1 testu1

UID与GID
要增加一个新组,必须编辑该文件,为新组加一个入口项. 由于用户登录时,系统从/etc/passwd文件中取GID,而不是从

/etc/group中 取GID,所以group文件和口令文件应当具有一致性.对于一个用户的小组,UID和 GID应当是相同的.多用

户小组的GID应当不同于任何用户的UID,一般为5位数,这 样在查看/etc/passwd文件时,就可根据5位数据的GID识别多

用户小组,这将减少 增加新组,新用户时可能产生的混淆


阅读(1245) | 评论(0) | 转发(0) |
0

上一篇:UNIX 各个文件系统的定义

下一篇:没有了

给主人留下些什么吧!~~