How Do I Assign a User to a Group in Linux?
Contents

How do you add a user to a group in Linux?

You can add a user to a group in Linux using the usermod command. To add a user to a group, specify the -a -G flags. These should be followed by the name of the group to which you want to add a user and the user’s username.

How do I add a user to a group?

To add an existing user account to a group on your system, use the usermod command, replacing examplegroup with the name of the group you want to add the user to and exampleusername with the name of the user you want to add.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest