Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

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
0
Los Angeles1
Asked:
Los Angeles1
1 Solution
 
arnoldCommented:
groupadd groupname
groupadd -g <GID> groupname
0
 
jgiordanoCommented:
usermod -g <gid #> user
0
 
jgiordanoCommented:
So it is capital G sorry

#usermod -G mantles mqm
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jgiordanoCommented:
Damn autocorrect

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

Use the groupadd example from above if the group doesn't exist
0
 
TintinCommented:
The correct syntax is

usermod -G mqbrkrs mqm

Open in new window


note that the username is specified last.
0
 
mohansahuCommented:

1.useradd Example - Add A New User To Secondary Group

useradd -G <Group name> <username>

useradd -G mqbrkrs mqm

2.usermod example - Add a existing user to existing group

usermod -a -G  mqbrkrs mqm


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now