Skip to main content
16 events
when toggle format what by license comment
Feb 28, 2023 at 2:19 history became hot network question
Feb 27, 2023 at 20:02 vote accept Saeed
Feb 27, 2023 at 19:36 comment added Cyrus Use a function in your ~/.bashrc with name useradd to do useradd and usermod. See help command.
Feb 27, 2023 at 19:36 history edited terdon CC BY-SA 4.0
Included information from comments; retagged
Feb 27, 2023 at 19:34 answer added terdon timeline score: 5
Feb 27, 2023 at 19:08 comment added Saeed @terdon it's CentOS 7.
Feb 27, 2023 at 19:00 answer added zomega timeline score: 0
Feb 27, 2023 at 18:45 comment added terdon 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.
Feb 27, 2023 at 18:31 comment added Señor CMasMas 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.
Feb 27, 2023 at 18:31 comment added Saeed @harrymc I know I can change user after creating or set group during creating, but that's just a question if it's possible to have something defined so that all new users are joined a specific group or not. Without any usermod or user add ... -G test
Feb 27, 2023 at 18:27 comment added harrymc Are you looking for usermod -a -G group user ?
Feb 27, 2023 at 18:26 comment added Saeed @KamilMaciorowski thanks, I just want to know for curiosity. It's not a question for a production environment. Only if that's possible or not.
Feb 27, 2023 at 18:26 comment added Saeed @FrankThomas I just want to know for curiosity. It's not a question for a production environment.
Feb 27, 2023 at 18:23 comment added Kamil Maciorowski "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?
Feb 27, 2023 at 18:22 comment added Frank Thomas 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
Feb 27, 2023 at 18:14 history asked Saeed CC BY-SA 4.0