2

There are so many variants to adduser or useradd -- which is correct?

On CentOS release 5.11 (Final) I'm using adduser --create-home baz but somewhat prefer the way Ubuntu asks extraneous questions about contact information. On Ubuntu, just adduser desired_user_name sudo which is easier to remember -- at least for me.

Digital Ocean says to use adduser and usermod:

Use the usermod command to add the user to the wheel group.

usermod -aG wheel username

By default, on CentOS, members of the wheel group have sudo privileges.

Just handled differently?

(This is on Elastix 2.5 (asterisk) running on CentOS.)

Thufir
  • 1,810
  • 6
  • 33
  • 60

1 Answers1

2

You can use -G

For CentOS Doc

-G<group-list>    

       List of additional (other than default) group names or group 
       numbers, separated by commas, of which the user is a member. The
       groups must exist prior to being specified here.

so you can do this with

useradd username -d <customer_home_dir_path> -G <group_names>
Raja G
  • 5,749
  • 12
  • 44
  • 67