Link to home
Start Free TrialLog in
Avatar of Los Angeles1
Los Angeles1

asked on

RHEL 6 add group question

I am trying to add user mqm to group mqbrkrs

I do the following but I can not quite get the commanf

[root@ex5b mqm]# groups mqm
mqm : mqm
[root@ex5b mqm]# id mqm
uid=495(mqm) gid=500(mqm) groups=500(mqm)
[root@ex5b mqm]#
[root@ex5b mqm]#
[root@ex5b mqm]# usermod mqm -g mqbrkrs
usermod: user 'mqbrkrs' does not exist
[root@ex5b mqm]#
[root@ex5b mqm]#
[root@ex5b mqm]# usermod mqm -G mqbrkrs[mqm]
usermod: user 'mqbrkrs[mqm]' does not exist
[root@ex5b mqm]#
[root@ex5b mqm]# useradd mqm -g mqbrkrs
useradd: user 'mqm' already exists
[root@ex5b mqm]#

Open in new window


What am I missions

BTW, what is the command to show a list of users in a group
Avatar of arnold
arnold
Flag of United States of America image

groupadd groupname
groupadd -g <GID> groupname
usermod -g <gid #> user
So it is capital G sorry

#usermod -G mantles mqm
Damn autocorrect

usermod -G <gid of mqbrkrs> <user to add>

Use the groupadd example from above if the group doesn't exist
Avatar of Tintin
Tintin

The correct syntax is

usermod -G mqbrkrs mqm

Open in new window


note that the username is specified last.
ASKER CERTIFIED SOLUTION
Avatar of mohansahu
mohansahu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial