The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding user to a group without SAM paqman HP-UX 2 08-15-2007 04:05 AM
Adding quota for a group manoranjan UNIX for Advanced & Expert Users 1 12-21-2006 01:35 PM
Adding users to /etc/group golfhakker UNIX for Dummies Questions & Answers 1 03-30-2006 01:27 PM
Adding an extension to a group of filenames pepintheshort UNIX for Dummies Questions & Answers 9 04-09-2004 05:11 PM
Adding a user to a group TRUEST UNIX for Dummies Questions & Answers 5 11-14-2003 08:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-21-2005
Registered User
 

Join Date: Oct 2005
Posts: 2
Adding root user to a group

Hey everyone, I need a little help....

I need to add my root user to a new group I have created, I'm just alittle unsure how to do this.

I know I need to use the 'useradd' command, the user 'root' needs to be added to a new group called 'beoper' and retain his membership in the following groups - 'other, root, bin, sys, adm, uucp, mail, tty, lp, nuucp, daemon'

Could someone please show me the correct syntax to perform this function, I really can't afford to screw this one up. Thanks.
Reply With Quote
Forum Sponsor
  #2  
Old 10-21-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
You have things slightly mixed up. useradd is used to add a new user to the system. If you want to edit the attributes of an existing user, you have to use usermod. Run the following command:
Code:
usermod -G beoper root
This will add beoper to the list of groups that root is already a member of. Here is the man page for usermod.
Reply With Quote
  #3  
Old 10-21-2005
Registered User
 

Join Date: Oct 2005
Posts: 2
Thanks for that.

Do I need to list all the other groups that root is a member of ?

The -G syntax states that you need to list all current groups or you will no longer be a members of those groups.

I just need to make sure, I can't have any mistakes.

Last edited by The Specialist; 10-21-2005 at 11:14 PM.
Reply With Quote
  #4  
Old 10-21-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Quote:
Originally Posted by blowtorch
This will add beoper to the list of groups that root is already a member of.
I don't think so... look at the man page....

Quote:
-G group,[...]
A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option. If the user is currently a member of a group which is not listed, the user will be removed from the group
Hence, the user will be, I assume, removed from all groups except their primary group and the beoper group.

I would just go and hack at the /etc/group file, and tack "root" onto the end of the beoper line (comma seperated with the other users listed).

Cheers
ZB
Reply With Quote
  #5  
Old 10-21-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Quote:
Originally Posted by The Specialist
Do I need to list all the other groups that root is a member of ?
If you use usermod, yes. Comma seperated, no spaces. Do not include primary group membership.

Cheers
ZB
Reply With Quote
  #6  
Old 10-22-2005
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,589
Quote:
Originally Posted by zazzybob
I would just go and hack at the /etc/group file, and tack "root" onto the end of the beoper line (comma seperated with the other users listed).
I'd also do it the way ZB suggests.
Reply With Quote
  #7  
Old 10-22-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Sorry for the wrong info. Actually, I always edit the /etc/group file and it really has been ages since I used the usermod command to add a user to a group.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0