How to add user to multiple groups | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

How to add user to multiple groups

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-09-2010
kalyankalyan kalyankalyan is offline
Registered User
 
Join Date: Apr 2010
Last Activity: 25 February 2014, 2:04 AM EST
Posts: 31
Thanks: 0
Thanked 1 Time in 1 Post
How to add user to multiple groups

hi all

i am new to solaris

how to add a user to multiple(secondary) groups.

user :anna
Groups : delhi ,mumbai,pune

i need like this in cat /etc/group
PHP Code:
delhi::anna
mumbai
::anna
pune
::anna 
i tried using
PHP Code:
usermod --G hyd anna 
that does int work

how to delete user from group in solaris

if i use userdel -r anna gelhi

user is geleted from /etc/passwd

pls help
Sponsored Links
    #2  
Old 08-09-2010
citaylor's Avatar
citaylor citaylor is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 9 August 2011, 2:12 AM EDT
Location: Somerset, UK
Posts: 405
Thanks: 0
Thanked 72 Times in 70 Posts
To Add Anna to delhi, mumbai and pune:

Code:
usermod -G delhi,mumbai,pune anna

And to remove anna from group Delhi:

Code:
usermod -G mumbai,pune anna

The "-G" list is definitive not additive.
Thx
Sponsored Links
    #3  
Old 08-09-2010
ygemici ygemici is offline Forum Advisor  
sed_shell@LNU
 
Join Date: Feb 2010
Last Activity: 1 September 2014, 4:12 AM EDT
Location: istanbul
Posts: 1,672
Thanks: 2
Thanked 286 Times in 279 Posts
Quote:
Originally Posted by kalyankalyan View Post
hi all

i am new to solaris

how to add a user to multiple(secondary) groups.

user :anna
Groups : delhi ,mumbai,pune

i need like this in cat /etc/group
PHP Code:
delhi::anna
mumbai
::anna
pune
::anna 
i tried using
PHP Code:
usermod --G hyd anna 
that does int work

how to delete user from group in solaris

if i use userdel -r anna gelhi

user is geleted from /etc/passwd

pls help
Add to group

Code:
 
# usermod -G hyd anna  

Remove from groups

Code:
 
# usermod -G "" anna  


    #4  
Old 08-10-2010
kalyankalyan kalyankalyan is offline
Registered User
 
Join Date: Apr 2010
Last Activity: 25 February 2014, 2:04 AM EST
Posts: 31
Thanks: 0
Thanked 1 Time in 1 Post
thakq......
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
user & groups senmak AIX 6 04-19-2009 06:34 PM
User groups Zak UNIX for Dummies Questions & Answers 3 05-10-2006 10:54 AM
Adding user to groups peteythapitbull UNIX for Dummies Questions & Answers 1 03-21-2006 09:35 PM
dynamic user groups hammer UNIX for Dummies Questions & Answers 0 10-28-2005 11:02 AM
Removing user from multiple groups via command line jquizon62 Solaris 1 10-28-2004 12:56 PM



All times are GMT -4. The time now is 02:44 AM.