Add User Group in Linux: Quick Guide

You can add a user group in a Linux system using the following command:

  1. Open the terminal and log in as the root user.
  2. Create a new user group using the following command:
sudo groupadd <group_name>

Replace with the name of the user group you want to create.

  1. To confirm if the user group has been created successfully, you can use the following command to check:
cat /etc/group
  1. To add an existing user to a newly created user group, you can use the following command:
sudo usermod -aG <group_name> <username>

Replace with the new group name, and with the username to be added to that group.

By following these steps, you can successfully add a new user group in the Linux system.

bannerAds