the correct way to add users to another group???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



kk, I am guilty of easily just booting up in Kde's gui, start/system
settings/users and groups but then also I'd rather do it from the bash
console.

after googling around a good bit I am still not exactly sure of the
proper way to do this.

I want to add a user to another group w/out removing the groups the user
already belongs to.

in man usermod:
      -G group,[...]
              A  list of supplementary groups which the user is also
a member of.  Each group is separated from the next by a comma, with  no
              intervening  whitespace.   The  groups  are subject to the
same restrictions as the group given with the  -g  option.   If  the
              user  is currently a member of a group which is not
listed, the user will be removed from the  group.  This  behaviour  can
be changed  via  -a option, which appends user to the current
supplementary group list.

ok...I kinda get this but unclear of the exact format and I am super
fearful of ripping up my userbase.

Here is what I think it should be:

# usermod <user> -a -G <group> 

where the user's name is say..."pete" and I want him to be added to the
group "tech":

# usermod pete -a -G tech

Say pete is already in groups ummm, sales,admin, and help. After
administering the above command, would pete still be in sales,
admin,help, and now tech? I am interested in the simplest, correct way
to do this.

thx,

John Rose


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux