当前位置: 技术问答>linux和unix
linux 中关于 useradd 的用法
来源: 互联网 发布时间:2017-01-29
本文导语: useradd 中这2个参数的用法,谁能更加形象的给我解释下哦 -g:指定用户所属的群组。 -G:指定用户所属的附加群组。 | 一个用户可以属于很多组,起码至少属于一个组,-g就是加入那个必须属于的组,-G...
useradd 中这2个参数的用法,谁能更加形象的给我解释下哦
-g:指定用户所属的群组。
-G:指定用户所属的附加群组。
-g:指定用户所属的群组。
-G:指定用户所属的附加群组。
|
一个用户可以属于很多组,起码至少属于一个组,-g就是加入那个必须属于的组,-G就是加入额外的组
-g, --gid GROUP name or ID of the primary group of the new
account
-G, --groups GROUPS list of supplementary groups of the new
account
-g, --gid GROUP
The group name or number of the user´s initial login group. The
group name must exist. A group number must refer to an already
existing group.
If not specified, the bahavior of useradd will depend on the
USERGROUPS_ENAB variable in /etc/login.defs. If this variable is
set to yes (or -U/--user-group is specified on the command line), a
group will be created for the user, with the same name as her
loginname. If the variable is set to no (or -N/--no-user-group is
specified on the command line), useradd will set the primary group
of the new user to the value specified by the GROUP variable in
/etc/default/useradd, or 100 by default.
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
A list of supplementary groups which the user is also a member of.
Each group is separated from the next by a comma, with no
intervening whitespace. The groups are subject to the same
restrictions as the group given with the -g option. The default is
for the user to belong only to the initial group.