group security

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am new. And this is likely to be a
very well understood topic, but its
new to me. So, here goes...

I'm just now becoming aware that if a user (myuser)
is a member of 2 or more groups and I want to add
them to another group - the usermod command will
allow me to do it.

IE, myuser is member of group1 and group2 already.
group1 is his PRIMARY group. I want to add him to
group3 so he'll be a member of all 3 groups. Here's
what I do...

usermod -G group2,group3 myuser

Is there another command I can use that just adds
him to the additional group3 without my having to
put in group2 (which he has already been a member
of for some time)?

Re: group security

MLH wrote:
Quoted text here. Click to load it

yea just edit the group file

Re: group security

OK. Thx.
Quoted text here. Click to load it

Re: group security

Quoted text here. Click to load it

for edit use vigr (it handles file locking in safe manor)

and check if your distribution has adduser because adduser

$adduser user group

and reverse with deluser

$deluser user group

to remove user from single group

 ____ __  ___| |  ___   Ignorance is    .~.    hrvoje.spoljar@><
(_-< '_ \/ _ \ |_/ -_)  bliss, but     / V \   irc # RoCkY
/__/ .__/\___/__/\___|  knowledge is  /(   )\  icq : 53000945  
   |_|                  power!          ^-^    

Re: group security

MLH wrote:
Quoted text here. Click to load it

Try the gpasswd command:

    gpasswd -a myuser group3

I have never understood why groupmod command doesn't
have more functionality, such as this.  But gpasswd is
a very convienent tool for working with groups.

If you use "vi", you can do that more safely with "vigr"
command.  When done use "grpck" command to check your
changes didn't corrupt anything.


Site Timeline