Solved

RHEL 6 add group question

Posted on 2011-03-22
6
841 Views
Last Modified: 2012-05-11
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
Comment
Question by:Los Angeles1
6 Comments
 
LVL 76

Expert Comment

by:arnold
ID: 35194977
groupadd groupname
groupadd -g <GID> groupname
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 35195036
usermod -g <gid #> user
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 35195043
So it is capital G sorry

#usermod -G mantles mqm
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 11

Expert Comment

by:jgiordano
ID: 35195071
Damn autocorrect

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

Use the groupadd example from above if the group doesn't exist
0
 
LVL 48

Expert Comment

by:Tintin
ID: 35195130
The correct syntax is

usermod -G mqbrkrs mqm

Open in new window


note that the username is specified last.
0
 
LVL 6

Accepted Solution

by:
mohansahu earned 500 total points
ID: 35197466

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now