![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Secondary groups show in groups but don't show in id (Not working) | zen03 | HP-UX | 4 | 12-31-2007 11:15 AM |
| Change a users primary group after login | terrym | UNIX for Advanced & Expert Users | 3 | 02-09-2007 03:03 AM |
| Help required for usermod command | gun | UNIX for Dummies Questions & Answers | 1 | 11-28-2006 05:45 AM |
| usermod -e | amheck | UNIX for Dummies Questions & Answers | 1 | 05-23-2006 07:02 PM |
| Assigning existing users to a secondary group | jyotipg | UNIX for Dummies Questions & Answers | 1 | 05-15-2002 03:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
usermod -G and Group id login replacing existing groups
Hi all
usermod -G Group_id login it is replacing the existiong Secoundry groups and is adding the only group speced in usermod command how can we retain the existing secoundry groups and add a user to a new group |
|
||||
|
The lack of an 'add' option has always bugged me too.
You can specify more than one group with -G, i.e. -G group1,group2,group3 but you'll have to extract group information somehow to get their previous groups. Closest I've gotten to that is Code:
egrep 'user[^:]+$' /etc/group |
sed 's/:.*//' |
xargs echo |
sed 's/ /,/g'
Last edited by Corona688; 11-02-2006 at 11:03 AM.. |
|
||||
|
Is this a reccomended practice? It's less dangerous than editing /etc/passwd, I suppose, but could still really mess up your system if you aren't careful. It's not something you can do from a script file, either.
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|