-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux groupadd Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to groupadd on Linux, covering Arch Linux, CachyOS, and other distributions including creating groups, group management, and permissions.
groupadd creates new groups.
Uses:
- Create groups: Add new groups
- Organize users: Group related users
- Permissions: Control file access
- Security: Manage access control
Why it matters:
- Access control: Share files with groups
- Organization: Organize users
- Security: Fine-grained permissions
Create group:
# Create group
sudo groupadd groupname
# Create with GID
sudo groupadd -g 1001 groupname
# Create system group
sudo groupadd -r systemgroupCommon options:
# Create with specific GID
sudo groupadd -g 1001 developers
# Create system group
sudo groupadd -r servicegroup
# Force creation
sudo groupadd -f groupnameModify group:
# Add user to group
sudo usermod -aG groupname username
# Or use gpasswd
sudo gpasswd -a username groupnameRemove member:
# Remove user
sudo gpasswd -d username groupname
# Or modify user
sudo usermod -G group1,group2 usernameChange ownership:
# Change group ownership
sudo chgrp groupname file.txt
# Recursive
sudo chgrp -R groupname directory/Set permissions:
# Set group permissions
chmod g+w file.txt
# Remove group write
chmod g-w file.txtCheck issues:
# Check if group exists
getent group groupname
# List all groups
getent group
# Check group members
getent group groupnameThis guide covered groupadd usage, group creation, and management for Arch Linux, CachyOS, and other distributions.
- User and Groups - User management
- chmod and chown Guide - Permissions
- useradd Guide - User creation
-
groupadd Documentation:
man groupadd
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.