- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: adding second secondray group to a user using ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 10:51 PM
тАО01-16-2003 10:51 PM
We knew that we can change the second secondary group to user(s) using sam. but how to achieve the same using command line.
groupmod changes the existing secondary group to the specified group.
Guys do u aware of any other alternatives.
thanx in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 10:54 PM
тАО01-16-2003 10:54 PM
Re: adding second secondray group to a user using command
check usermod man page for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 10:59 PM
тАО01-16-2003 10:59 PM
Re: adding second secondray group to a user using command
I am sorry, instead of usermod i have mentioned as groupmod in my question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 11:09 PM
тАО01-16-2003 11:09 PM
Re: adding second secondray group to a user using command
run grpck afterwards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 11:12 PM
тАО01-16-2003 11:12 PM
Re: adding second secondray group to a user using command
see man groupadd
Regs
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 11:22 PM
тАО01-16-2003 11:22 PM
Re: adding second secondray group to a user using command
When using secondary group to a user, it changes the existing secondary group.
But you can use my script to add additional secondary groups
EG=`/usr/bin/groups $1|sed 's/ /.g'`
NG=$EG,$2
/usr/sbin/usermod -G $NG $1
You can pass username and the secondary group name that has to be added.
Hope this helps u.
Srini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2003 11:23 PM
тАО01-16-2003 11:23 PM
SolutionSorry my previous post has a error on the sed. use the following.
When using secondary group to a user, it changes the existing secondary group.
But you can use my script to add additional secondary groups
EG=`/usr/bin/groups $1|sed 's/ /,/g'`
NG=$EG,$2
/usr/sbin/usermod -G $NG $1
You can pass username and the secondary group name that has to be added.
Hope this helps u.
Srini.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2003 12:53 AM
тАО01-17-2003 12:53 AM
Re: adding second secondray group to a user using command
thanx, your script worked