This is a discussion on group security within the Linux Security forums, part of the System Security and Security Related category; I am new. And this is likely to be a very well understood topic, but its new to me. So, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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)? |
|
|||
|
MLH wrote:
> 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)? yea just edit the group file |
|
|||
|
JD <No@Reply.com> pise na comp.os.linux.security:
[CUT] >> 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)? > > yea just edit the group file for edit use vigr (it handles file locking in safe manor) and check if your distribution has adduser because adduser supports $adduser user group and reverse with deluser $deluser user group to remove user from single group -- ____ __ ___| | ___ Ignorance is .~. hrvoje.spoljar@><.pbf.hr (_-< '_ \/ _ \ |_/ -_) bliss, but / V \ irc # RoCkY /__/ .__/\___/__/\___| knowledge is /( )\ icq : 53000945 |_| power! ^-^ |
|
|||
|
MLH wrote:
> 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)? 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. -Wayne |