01-23-04 10:11 PM
in comp.unix.admin i read:
quote:
>Whenever I do:
>
> usermod -G groupname username
>
>.... any existing supplementary group of username, as shown from
>/etc/group, gets removed and the new one added.
naturally, exactly as your documentation says will happen ...
quote:
> -G group
> Specify an existing group's integer "ID" "," or char-
> acter string name. It redefines the user's supplemen-
> tary group membership.
i.e., it specifies the group list, replacing whatever is current.
quote:
>Is it alright then to just directly modify /etc/group so that the
>username is in more than one supplementary group ?
that's one way. be sure you aren't editing the file while others are doing
so, otherwise you'll have a `last writer wins' result, i.e., your changes
may disappear. your system may have a `vigr' command which performs simple
locking to prevent such from happening.
another way is to enumerate the current list and append the new group so
that usermod can be presented with a list with which i wants to work and
you get the result you want, e.g.,
# usermod -G `id -G $user | tr ' ' ,`,$addgroup $user
--
a signature
[ Post a follow-up to this message ]
|