Add Members to a Group
Steps to Add an Existing User to a Group
Follow these steps to add an existing user to a secondary group:
Method 1: Using the usermod Command
To add an existing user account to a group, use the usermod command:
```bash usermod -aG examplegroup username ```Method 2: Using the adduser Command
You can also add users to a group using the adduser command:
```bash adduser username examplegroup ```Method 3: Using the groupadd Command
If the group doesn't exist, you can create it and then add a user to it using the groupadd and usermod commands:
```bash groupadd examplegroup usermod -aG examplegroup username ```
Comments