mkgroup
Create a new group
SYNOPSIS
mkgroup [OPTIONS] GROUPNAME
or
mkgroup [ -g GID ] [ -r ] GROUPNAME
PARAMETERS
GROUPNAME
The name of the new group to be created. This name should be unique and follow system naming conventions (typically alphanumeric, no spaces, usually 1 to 32 characters).
-g GID
Specifies the numeric Group ID (GID) for the new group. If this option is omitted, the system typically assigns the next available GID automatically from a defined range.
-r
Creates a system group. System groups are typically used for system accounts and are assigned GIDs from a reserved lower range (e.g., below 1000).
DESCRIPTION
Groups are a fundamental concept in Linux for managing file permissions and user access. The conceptual command mkgroup is designed to create a new group entry on the system, allowing administrators to organize users into logical collections for permission management.
Crucial Point: On most modern Linux distributions (e.g., Debian, Ubuntu, RHEL, Fedora, Arch Linux), the standard command to add a new group is not mkgroup but rather groupadd. mkgroup might be found on older Unix systems or specific proprietary distributions like SCO OpenServer. This analysis describes its conceptual role and typical functionalities if it were a standard Linux utility, mirroring what groupadd provides.
When executed, mkgroup conceptually performs several actions:
It creates a new entry in the /etc/group file, which stores group names and their respective Group IDs (GIDs).
If shadow passwords are in use, it also creates an entry in the /etc/gshadow file for password protection and administration information associated with the group.
It typically assigns a unique GID to the new group, either automatically from an available range or based on a specified GID.
CAVEATS
The primary caveat is that mkgroup is not a standard command on most contemporary Linux distributions. Users should use the groupadd command instead, which provides equivalent and often more extensive functionalities.
Creating groups requires superuser privileges (root access or via sudo). Improper use, such as assigning duplicate GIDs, can lead to system instability or security issues.
Directly editing the /etc/group or /etc/gshadow files is strongly discouraged as it can lead to file corruption or inconsistencies.
PERMISSIONS REQUIRED
Only the root user or a user with sudo privileges can execute mkgroup (or groupadd) to create new groups. This is a security measure to prevent unauthorized changes to system group configurations.
FILES MODIFIED
The command typically modifies the /etc/group file, which lists all system groups and their members. If shadow passwords are enabled, it also updates the /etc/gshadow file, which stores encrypted group passwords and group administration information.
HISTORY
The concept of a 'make group' command, often named mkgroup, was more common in older Unix variants, such as SCO Unix, Xenix, and some proprietary systems. These systems often had commands like mkuser, mkgroup, etc., that directly reflected their action.
With the rise of Linux and the standardization of system administration tools, a more consistent naming convention emerged. Commands like groupadd, groupdel, and groupmod (and their user counterparts: useradd, userdel, usermod) became the standard across major Linux distributions. This shift provided a more unified and extensible interface for managing users and groups, leading to the deprecation or absence of mkgroup in modern Linux environments.