?
Solved

RHEL 6 add group question

Posted on 2011-03-22
6
Medium Priority
?
885 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 79

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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

752 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