- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to set umask for group
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
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
тАО09-24-2002 03:52 PM
тАО09-24-2002 03:52 PM
I remember somewhere reading that it's easy to do, but can't for the life of me remember how.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2002 04:12 PM
тАО09-24-2002 04:12 PM
Re: how to set umask for group
I believe you are looking for 'setprivgrp' [although setting the 'umask' isn't a direct option]. See the man (1M) pages for 'setprivgrp'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2002 04:29 PM
тАО09-24-2002 04:29 PM
Re: how to set umask for group
I don't see any way to do this to any *other* user or group from a command because the umask command itself only works on the current shell.
I suspect you'd have to search the passwd file for all primary members (group file for secondary members) of a group & extract the home dir & edit the .profile (.login) file within that home dir - setting the umask there.
Then the mask will apply upon next login.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2002 04:41 PM
тАО09-24-2002 04:41 PM
Re: how to set umask for group
I don't see a perfect solution for you. One thing to consider would be to set up a skeleton profile for each group that you intend using and have the umask set that way. I would of course still keep the the umask setting in /etc/profile just in case.
As Jeff mentioned, the umask is set by each users shell.
Cheers
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-24-2002 04:45 PM
тАО09-24-2002 04:45 PM
SolutionYou asked specifically about 'umask'. My answer above using 'setprivgrp' is predicated on the fact that if you confer the ablity to 'chown' then you confer ability to change permission bits ('chmod'), too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2002 05:27 AM
тАО09-26-2002 05:27 AM
Re: how to set umask for group
Are you just trying to have new files created in a directory retain the directories group id? If so, you would chmod g+s /mydir. This will not change the group of existing files, so you may have to chgrp -R mygrp /mydir.
As far as affecting the umask of all members of a group, you could try to implement a shared .profile or .cshrc that sets the umask (and other things) for everyone belonging to a particular group. For example:
MYGRP=mygrp
if [ -n "`groups | grep $MYGRP`" ]
then
echo "Sourcing central .profile for group $MYGRP"
. /nfsmnt/mygrp/mygrp.profile
fi
and /nfsmnt/mygrp/.profile is on an nfs mounted directory and contains the umask 007 command and what ever else is specific to your group.
HTH,
Keith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2002 05:37 AM
тАО09-26-2002 05:37 AM
Re: how to set umask for group
if [[ `id -g` -eq 20 ]]
then
umask 022
else
umask 077
fi