GROUPMOD

åç§°
大纲
æè¿°
é项
éç½®æä»¶
æä»¶
éåºå¼
åè§


åç§°

groupmod − modify a group definition on the system

大纲

groupmod [é项] GROUP

æè¿°

The groupmod command modifies the definition of the specified GROUP by modifying the appropriate entry in the group database.

é项

groupmod å½ä»¤å¯ä»¥æ¥åçé项æï¼

−g, −−gid GID

The group ID of the given GROUP will be changed to GID.

The value of GID must be a non−negative decimal integer. This value must be unique, unless the −o option is used.

Users who use the group as primary group will be updated to keep the group as their primary group.

Any files that have the old group ID and must continue to belong to GROUP, must have their group ID changed manually.

No checks will be performed with regard to the GID_MIN, GID_MAX, SYS_GID_MIN, or SYS_GID_MAX from /etc/login.defs.

−h, −−help

ç°å®å¸®å©ä¿¡æ¯å¹¶éåºã

−n, −−new−name NEW_GROUP

The name of the group will be changed from GROUP to NEW_GROUP name.

−o, −−non−unique

When used with the −g option, allow to change the group GID to a non−unique value.

−p, −−password PASSWORD

å·²ç»å å¯è¿çå¯ç ï¼å°±å crypt(3) è¿åç飿 ·ã

注æï¼ä¸æ¨è使ç¨è¿ä¸ªé项ï¼å ä¸ºå¯ç (æå å¯è¿çå¯ç )ä¼è¢«ç¨æ·éè¿ååºè¿ä¸ªè¿ç¨èçå°ã

æ¨åºè¯¥ç¡®ä¿å¯ç ç¬¦åç³»ç»çå¯ç æ¿çã

−R, −−root CHROOT_DIR

Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.

−P, −−prefix PREFIX_DIR

Apply changes in the PREFIX_DIR directory and use the configuration files from the PREFIX_DIR directory. This option does not chroot and is intended for preparing a cross−compilation target. Some limitations: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. No SELINUX support.

éç½®æä»¶

å¨ /etc/login.defs 䏿å¦ä¸éç½®åéï¼å¯ä»¥ç¨æ¥æ´æ¹æ¤å·¥å·çè¡ä¸ºï¼

MAX_MEMBERS_PER_GROUP (number)

æ¯ä¸ªç»æ¡ç®çæå¤§æåæ°ãè¾¾å°æå¤§å¼æ¶ï¼å¨ /etc/group å¼å§ä¸ä¸ªæ°æ¡ç®(è¡)(使ç¨åæ ·çåç§°ï¼åæ ·çå¯ç ï¼åæ ·ç GID)ã

é»è®¤å¼æ¯ 0ï¼æå³çç»ä¸çæåæ°æ²¡æéå¶ã

æ¤åè½(åå²ç»)å许éå¶ç»æä»¶ä¸çè¡é¿åº¦ãè¿å¯¹äºç¡®ä¿ NIS ç»çè¡æ¯é¿äº 1024 å符ã

妿è¦å¼ºå¶è¿ä¸ªéå¶ï¼å¯ä»¥ä½¿ç¨ 25ã

注æï¼åå²ç»å¯è½ä¸åææå·¥å·çæ¯æ(çè³å¨ Shadow å·¥å·éä¸- )ãæ¨ä¸åºè¯¥ä½¿ç¨è¿ä¸ªåéï¼é¤éççéè¦ã

æä»¶

/etc/group

ç»è´¦æ·ä¿¡æ¯ã

/etc/gshadow

å®å¨ç»è´¦æ·ä¿¡æ¯ã

/etc/login.defs

Shadow å¯ç å¥ä»¶éç½®ã

/etc/passwd

ç¨æ·è´¦æ·ä¿¡æ¯ã

éåºå¼

groupmod å½ä»¤å¯ä»¥è¿åå¦ä¸å¼ï¼

0

E_SUCCESS: success

2

E_USAGE: invalid command syntax

3

E_BAD_ARG: invalid argument to option

4

E_GID_IN_USE: specified group doesn’t exist

6

E_NOTFOUND: specified group doesn’t exist

9

E_NAME_IN_USE: group name already in use

10

E_GRP_UPDATE: can’t update group file

11

E_CLEANUP_SERVICE: can’t setup cleanup service

12

E_PAM_USERNAME: can’t determine your username for use with pam

13

E_PAM_ERROR: pam returned an error, see syslog facility id groupmod for the PAM error message

åè§

chfn(1), chsh(1), passwd(1), gpasswd(8), groupadd(8), groupdel(8), login.defs(5), useradd(8), userdel(8), usermod(8).