Solved

RHEL 6 add group question

Posted on 2011-03-22
6
870 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 78

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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

695 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