Operating System - HP-UX
1753406 Members
7232 Online
108793 Solutions
New Discussion

change group name or add to secondary group on the fly

 
zxcv
Super Advisor

change group name or add to secondary group on the fly

hi ,

Can i change group of a specific user from one to another on the fly or atleast can i add that user to a secondary group even though he is logged in .

 

Am using hp ux 11i v2

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: change group name or add to secondary group on the fly

You can always directly edit /etc/passwd and /etc/group.

For 11.31, there is a -F option to usermod(1m) to force it, even if in use.

zxcv
Super Advisor

Re: change group name or add to secondary group on the fly

Hi Dennis ,

 

When i directly edit /etc/passwd and group am able to view through id command that the group is changed..i.e primary , but still chown needs to be run right ?

 

I just want to segregate my current 100 users in 4 groups say dc1 dc2 dc3 dc4 ;

its fine if i dont change their primary group , i just want segregation for my admin purpose , how can i achieve it on the fly .

 

Dennis Handly
Acclaimed Contributor

Re: change group name or add to secondary group on the fly

>but still chown needs to be run right?

 

Yes, that or chgrp(1).

>I just want to segregate my current 100 users in 4 groups say dc1 dc2 dc3 dc4

 

You can do a find with "-user user-name":

find path -user user-name -exec chgrp group-name {} +