- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to merge two user groups
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
тАО03-22-2011 05:08 AM
тАО03-22-2011 05:08 AM
we have two user groups (smb and users) sometime we have to merge these two group( including all group privilege) sometime I have to separate these two groups. how I can perform these in HPUX.
Josin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2011 07:16 AM
тАО03-22-2011 07:16 AM
Re: How to merge two user groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2011 08:16 AM
тАО03-22-2011 08:16 AM
SolutionIn this case you can manage all needed access by assigning it to one of the below options: smb, users or smbusers.
I hope, I understand you correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2011 10:57 PM
тАО03-22-2011 10:57 PM
Re: How to merge two user groups
Vague information on this requirement.
Victor, your way may parallel to Josin requirment.
Rgds...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2011 02:29 AM
тАО03-23-2011 02:29 AM
Re: How to merge two user groups
Currently in our server we have two groups smb and users. I also don├в t know which all are files has these group permissions. I want to give group permission of smb to all members of users group for a short period.
If I create a new group smbusers .it would be difficult for me to change all old existing files group permission. Is there any options to add/remove a group ( users ) as secondary group of other group ( smb ) ,same as ├в usermod ├в G user user1├в in user administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2011 05:09 AM
тАО03-23-2011 05:09 AM
Re: How to merge two user groups
/etc/group
smb::200:bill,dave,peggy...
users::20:bill,dave
The primary group is defined as the one listed in /etc/passwd. It can be changed at any time. The only effect of the primary group is the initial ownership of files and directories created by the user. Otherwise, the multi-group users share the same rights in each group.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2011 10:10 AM
тАО03-23-2011 10:10 AM
Re: How to merge two user groups
- you have a group, "smb" with specific permissions to an unknown set of files
- you want to temporarily grant the same specific permissions to all users in the group "users"
- you don't want/can't alter the permissions of the files themselves
About the only solution I can think of is to script modifying the /etc/group file, appending the members of "users" to "smb".
Below is a SAMPLE of the logic for one way you might do this. Additional checking for file integrity (grpck), max line lengths, etc. have been omitted for clarity and need to be added.
grep -v smb:: /etc/group > /etc/group.temp
SMP=$(grep smp:: /etc/group)
USERS=$(grep users:: /etc/group | cut -f 4 -d ":")
echo $SMP,$USERS >> /etc/group.temp
mv /etc/group /etc/group.orig \
&& mv /etc/group.temp /etc/group \
&& touch /etc/group.temp_in_place
And to restore the original permissions...
rm /etc/group && \
mv /etc/group.orig /etc/group && \
rm /etc/group.temp_in_place
CAUTION: unexpected results are likely to occur if the group file becomes corrupt. Use at your own risk!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2011 10:18 AM
тАО03-23-2011 10:18 AM
Re: How to merge two user groups
Should have been:
SMB=$(grep smb:: /etc/group)
USERS=$(grep users:: /etc/group | cut -f 4 -d ":")
echo $SMB,$USERS >> /etc/group.temp