Solved

RHEL 6 add group question

Posted on 2011-03-22
6
857 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
trouble on installing syslog-ng on CentOS 7 7 100
Apache LDAP Authentication 20 55
SSH to Solaris server (which uses NIS) 1 20
check the file dates in unix 14 29
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…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

733 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