- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Maintaining directory permissions
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
Forums
Discussions
Discussions
Discussions
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
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
08-25-2003 11:29 AM
08-25-2003 11:29 AM
drwxrwxr-x root nssi2
I want all newly created files and folders to also get these permissions.
Can this be done? If so how?
Thanks again,
Greg
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 11:37 AM
08-25-2003 11:37 AM
SolutionReason 1:
Unix requires explicit change of a file from non-executable status to executable status.
Take that out and you can maintain permissions of the files by setting the umask parameter on the users writing there.
umask 002
touch me
That will get you what you want except for executable priviledges. It is a security hazard to assume a file is an executable, but it might be needed.
To do that, you'll need a cron or other script that does this:
chmod a+x /opt/i2
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 11:38 AM
08-25-2003 11:38 AM
Re: Maintaining directory permissions
Setting your 'umask' to 002 will enable you to create directories with the default permissions "rwxrwxr-x". Alternately, you can use the 'mkdir -m' syntax to specify the mode you desire. Files, however, will never have their executable permissions set by default. You will need to 'chmod' files to gain the execute permissions.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 11:48 AM
08-25-2003 11:48 AM
Re: Maintaining directory permissions
You should also note that umask can be changed by a user/process at any time so that relying upon umask even for everything except executables is really no answer.
About the only 'sure fire' method (and it's a kludge) is to fire off a cron job periodically to check/set the permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 12:12 PM
08-25-2003 12:12 PM
Re: Maintaining directory permissions
First, change the permissions of the directory to 4775. This will make sure that all files written in this directory will be owned by group "nssi2" and the corresponding user of this group.
Next, for every user belonging to nssi2 group you should add the following line to ~/.profile:
umask 0002
which will make all files to be created with permissions 664 - if they are directories, they will be created with 4775 as the parent directory.
HTH
Paulo Fessel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 12:31 PM
08-25-2003 12:31 PM
Re: Maintaining directory permissions
By setting the umask to 0002, you will get close.
The problem is that files are never created with an executable bit. Compilers and of course archives can create this bit, but in reality it's a separate operation. Unix treats a file as a file.
You will need to make a simple cron job, that sets the permissions you like.
Like someone mentioned previously, it's very insecure. So dont be upset if bad things happen.
Sincerely,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 12:51 PM
08-25-2003 12:51 PM
Re: Maintaining directory permissions
* difficult to implement
* pointless (unless you're creating executable files in this directory with a compiler; in this case the compiler will set the --x flag itself)
Also, as others also noticed, this scheme is really insecure unless you use a umask 0007 - that is, files will be created with 660 permissions, and will be ever owned by the user that created it and the respective group of /opt/i2.
HTH
Paulo Fessel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 10:57 PM
08-25-2003 10:57 PM
Re: Maintaining directory permissions
If my memeory servers me well, you can set an acl on a directorie that says : each directory must inherite my acl's and so do files recursively.
On my system it seems i cannot access the manpages, but i think you require vxfs v4.