- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need to set a permission set recursively & aut...
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-10-2009 02:38 AM
тАО09-10-2009 02:38 AM
Need to set a permission set recursively & automatically for future
I have a directory in which some files are getting created daily but not with the permission set of the folder and as a result we are facing an error on one file system daily.
I need to set a permission set recursively so that every time when a new directory or file is created in that directory, it gets the same set of permission.
Please suggest
Thanks in Advance
Best regards
Arun Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2009 03:32 AM
тАО09-10-2009 03:32 AM
Re: Need to set a permission set recursively & automatically for future
The permisssion bits of a file or directory are established at the moment of creation using open() or creat() with a "mode". This mode is then "anded" with the 'umode' setting. The default mode for files is 0666 and for directories 0777. Hence when running with a 'umask' of 0, a file would have only read/write permissions for the owner, group, and world.
Your recourse may be to periodically, recursively, 'chmod -R 0nnn' your appplication directory.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2009 04:14 AM
тАО09-10-2009 04:14 AM
Re: Need to set a permission set recursively & automatically for future
To explain the bitmask abit this is how you decipher it. (for future references)
First n is "owner user" (also designated "u", this is valid for the user assigned by chown).
Second n is "owner group" (also designated "g", this is valid for the group assigned by chgrp)
Third n is "others" (also designated "o", this is for everyone)
You can also use "a" for all of them or write "ugo". It's the same.
You can set permissions via chmod by using letter description or by bitmask.
Using the first method setting all permissions for "owner user" one could write as follows.
chmod u+rwx file.txt
Using the bitmask method you need to know which value r, w and x has.
x is 1
w is 2
r is 4
so a combination of these will create the appropriate rwx combination.
5 = 4 + 1 = rx
6 = 4 + 2 = rw
7 = 4 + 2 + 1 = rwx
therefor, setting -rwxrw-rw- on a file will be 0766.
Hope this clarifies :)
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2009 01:26 AM
тАО09-11-2009 01:26 AM
Re: Need to set a permission set recursively & automatically for future
I suggest that you look also at the man page of umask. You can change it in the profile of the user wich creates files.
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2009 03:36 AM
тАО09-11-2009 03:36 AM
Re: Need to set a permission set recursively & automatically for future
chmod -R is a very dangerous command. Make sure you don't use it on / or /usr, etc.
You may want to use "chmod xxx path/*".
If you are going to use -R, you should use symbolic patterns so you don't give execute access to files or take them away from
directories.
chmod -R a+w path