adduser username groupname
and the user username will be added to the group groupname.
Newsgroups: comp.os.linux.misc Date: 2001-01-15 00:50:07 PST
> Is there a shell utility to add a user to a group? I know usmod -G > almost does the job, but instead of adding the user to a group, it > modifies the user's group settings.
ok, after a little playing around, I found the following solution which I think is simple enough:
usermod -G `id -Gn user | tr ' ' ,`,group user
Jim H
> And it has been. In Debian I just type > > adduser username groupname > > and the user username will be added to the group groupname. > > Of course, you could also just run vigr.
Doesn't work that way on Redhat. Didn't know about vigr. Just goes too so no matter how long you use something, there is always something new to learn.
Jim H