LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   "groupmod -A" missing (http://www.linuxquestions.org/questions/linux-software-2/groupmod-a-missing-4175434456/)

fakie_flip 10-28-2012 04:49 AM

"groupmod -A" missing
 
1 Attachment(s)
I am watching some videos meant to help prepare for the Linux+ Certification Exams (there's 2). This guy is using a Suse system for demonstrating. He then uses groupmod -A and it works on his system. However my groupmod does not have a -A option on CentOS 6.3. See the attached picture.

druuna 10-28-2012 05:40 AM

Too my knowledge, groupmod's -A option is Suse specific (adding multiple users to a group). The "out of the box" linux tools do not support this.

In general you can use usermod to add group(s) to one specific user:
Code:

usermod -aG group1,group2 user

fakie_flip 10-29-2012 03:54 AM

So without Suse, you can't add several users to a group in one command?

The example you show is adding a single user to several groups rather than adding several users to one group.

TristanM-TX 06-02-2015 03:26 AM

I also saw a similar example using what I remember to be RHEL6. I mention it because it advised this:

[usermod -G groupname,groupname2 username --- When you add a member this way- you have to list the other groups they are members for as well, or they will be removed from any group not listed! use groupmod instead: groupmod -A "user1, user2, user3" groupname]

Out of paranoia, I would suggest testing out these on a particular version of Linux before blindly relying on them to do the expected (or unexpected) ... test and "cat /etc/groups" or id

I was cleaning out my old notes and am glad I caught this to flag. I just read that the thing about having to list all groups with usermod -G is verified in Solaris


All times are GMT -5. The time now is 11:02 PM.