LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2013, 01:34 PM   #1
iceman81
Member
 
Registered: Jan 2013
Location: New Jersey
Distribution: CentOS, Arch
Posts: 153

Rep: Reputation: Disabled
commands from RHC* book giving error


doing an exercise on Setgid bit, and the lab has me creating a group called sdatagrp and adding 2 users to it

#groupadd -g 9999 sdatagrp --this works

#usermod -G ahgori sdatagrp
usermod: user 'sdatagrp' does not exist

I understand that when you create a user, they get added to a group same as their name, but creating a user just to make a group seems silly.


anyone know why this isn't working?

Edit: forgot to mention im using CentOS

Last edited by iceman81; 09-14-2013 at 01:47 PM.
 
Old 09-14-2013, 02:06 PM   #2
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 118

Rep: Reputation: Disabled
You are using 'usermod' instead of 'useradd'. If user doesn't exist you can't modify it.

Last edited by GNU/Linux; 09-14-2013 at 02:07 PM.
 
1 members found this post helpful.
Old 09-14-2013, 02:37 PM   #3
iceman81
Member
 
Registered: Jan 2013
Location: New Jersey
Distribution: CentOS, Arch
Posts: 153

Original Poster
Rep: Reputation: Disabled
im trying to modify the existing user to be added to the group sdatagrp which i just created

when i use useradd, like this #useradd -g sdatagrp aghori
i get : user aghori already exists , if i do it the other way it just creates a user named sdatagrp and puts it in aghori group. not what i want.

which leads me to believe the book is correct in saying i need to use usermod

Last edited by iceman81; 09-14-2013 at 02:48 PM.
 
Old 09-16-2013, 04:27 AM   #4
bebetter
LQ Newbie
 
Registered: Sep 2013
Posts: 4

Rep: Reputation: Disabled
thanks very much
 
Old 09-16-2013, 04:57 AM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
-G identifies
http://pic.dhe.ibm.com/infocenter/ai...%2Fusermod.htm
 
Old 09-16-2013, 05:03 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://www.cyberciti.biz/faq/howto-l...user-to-group/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo not giving me all commands, I have to su. Romanus81 Slackware 6 03-14-2008 10:26 AM
giving a router commands fakie_flip Linux - Software 1 08-01-2006 11:56 PM
Value of an RHC* logosys Linux - Enterprise 1 08-07-2005 01:52 PM
Giving OS commands nyumedic2000 Linux - Newbie 1 04-15-2005 08:16 PM
giving commands blotch Linux - Newbie 9 06-22-2003 04:13 AM


All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration