![]() ![]() There is no real technical difference between the system and regular (normal) groups. When used with the -o ( -non-unique) option the groupadd command allows you to create a group with non-unique GID: groupadd -o -g 1010 mygroup Creating a System Group # If a group with the given GID already exist, you will get the following error: groupadd: GID '1010' already exists : getent group | grep mygroup mygroup:x:1010: You can verify the group’s GID, by listing all groups ![]() Use the -g ( -gid) option to create a group with a specific GID.įor example to create a group named mygroup with GID of 1010 you would type: groupadd -g 1010 mygroup In Linux and Unix-like operating systems, groups are identified by its name and a unique GID (a positive integer).īy default, when a new group is created, the system assigns the next available GID from the range of group IDs specified in the fs file. To suppress the error message if the group exist and to make the command exit successfully, use the -f ( -force) option: groupadd -f mygroup Creating a Group with Specific GID # If the group with the same name already exist, the system will print an error message like the following: groupadd: group 'mygroup' already exists Once the group is created, you can start adding users to the group The command adds an entry for the new group to the /etc/group and /etc/gshadow files. To create a new group type groupadd followed by the new group name.įor example, to create a new group named mygroup you would run: groupadd mygroup When invoked, groupadd creates a new group using the options specified on the command line plus the default values specified in the /etc/fs ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |