Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

10
  • 1
    well, you do need to change the command in order to add additional groups. per the man pages, use the -G option to list additional groups eg: useradd -s /bin/bash -m user1 -G test linux.die.net/man/8/useradd Commented Feb 27, 2023 at 18:22
  • 2
    "I want to add all of these users to a group called test but I do not want to change the above command." – Please make sure there is no XY problem here. Why cannot you adjust the commands? or use few extra commands? Commented Feb 27, 2023 at 18:23
  • @FrankThomas I just want to know for curiosity. It's not a question for a production environment.
    – Saeed
    Commented Feb 27, 2023 at 18:26
  • 1
    Unix does not work this way. you need to change your command line (with -G) or add additional commands to commit users to group. your only "default" group is your primary group which matches the user name. Commented Feb 27, 2023 at 18:31
  • 1
    What Linux are you asking about? Do you also have adduser available? Also, if you want to know how to make this happen by default, you need to mention that in your question, so please edit and explain exactly what you need.
    – terdon
    Commented Feb 27, 2023 at 18:45