How to add user to multiple groups


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to add user to multiple groups
# 1  
Old 08-09-2010
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
# 2  
Old 08-09-2010
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
# 3  
Old 08-09-2010
Quote:
Originally Posted by kalyankalyan
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
thakq......
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Can we add multiple groups to a directory or a file ?

Hello, drwxr-x--- 21 root system 4096 Jan 25 10:20 /testdir here owner is root, group is system. 1) is it possible to add multiple groups to "/testdir" files/directories ? if yes, please provide me the command. my requirement is to provide read-only access to user1 on /testdir... (6 Replies)
Discussion started by: aaron8667
6 Replies

2. UNIX for Dummies Questions & Answers

Users in multiple groups?

Happy Thanksgiving Everyone!! I have a question about adding users to multiple groups. Thanks in advance Using Red Hat and here are the issues: Example: Users: Bob Mark Groups: SystemsAnalysts BusinessAnalysts If I am adding a user Bob to both groups (SystemsAnalysts and... (2 Replies)
Discussion started by: hansokl
2 Replies

3. AIX

Nested user groups

Is there a command to nest a group in another group in AIX. (2 Replies)
Discussion started by: daveisme
2 Replies

4. AIX

user & groups

1 - what is the maximum no: of groups a user can be a part of ? 2 - what is maximum no: of users a group can contain ? (6 Replies)
Discussion started by: senmak
6 Replies

5. Solaris

Setting user groups

Hi......... I'm trying to set a group of users to login to do a required super-user tasks without knowing the super-user passwd. For example...a user popodude logs in as self with passwd..system accepts the password & then automatically asks for the super-user account passwd. My goal is... (1 Reply)
Discussion started by: Remi
1 Replies

6. UNIX for Dummies Questions & Answers

User groups

Hi I have a user zak and 4 groups:- oracle stats data archive I want user zak to be part of the oracle and stats group but not be able to view,list anything in data and archive. Also anyone in the data and archive group should not be able to view,list anything in oracle and stats....... (3 Replies)
Discussion started by: Zak
3 Replies

7. UNIX for Dummies Questions & Answers

Adding user to groups

How do I add a user to a group? And how do I determine the list of groups to add a user? Solaris 10 newbie (1 Reply)
Discussion started by: peteythapitbull
1 Replies

8. UNIX for Dummies Questions & Answers

dynamic user groups

Is it possible to dynamically allocate a new user group to an existing session on Solaris 5.8 I'd like to be able to allow certain users to access a set of scripts for the life of session (preferably there own session not a specific login created for the purpose) by dynamically giving the session... (0 Replies)
Discussion started by: hammer
0 Replies

9. Shell Programming and Scripting

User add on multiple servers

I have 85 Unix servers & I need to add single user ID on multiple servers at same time Can anyone help in this? I have written one script for single servers.same I need to user for multiple servers #!/bin/sh echo Enter user login ID read loginID echo Enter Group ID read GroupID ... (6 Replies)
Discussion started by: sandeep_pan
6 Replies

10. Solaris

Removing user from multiple groups via command line

Want to know if any, a command line parameter(s) of removing a user from multiple groups without using any ineractive application? (1 Reply)
Discussion started by: jquizon62
1 Replies
Login or Register to Ask a Question