LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   commands from RHC* book giving error (https://www.linuxquestions.org/questions/linux-newbie-8/commands-from-rhc%2A-book-giving-error-4175477129/)

iceman81 09-14-2013 12:34 PM

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

GNU/Linux 09-14-2013 01:06 PM

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

iceman81 09-14-2013 01:37 PM

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

bebetter 09-16-2013 03:27 AM

thanks very much

EDDY1 09-16-2013 03:57 AM

-G identifies
http://pic.dhe.ibm.com/infocenter/ai...%2Fusermod.htm

EDDY1 09-16-2013 04:03 AM

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


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