The users can create files on specified directory with right access 775 (rwx-rwx-r-x) without using crontab to chmod -R g+w /dir1/dir2/file1. But the users can get files with right access 775 if the files created.
Any suggestion?
I think there are some words missing from your enquiry, and to try to guess what they are (and where they should go) might drastically change the meaning. However, here is some insight into files.
Ignoring ACLs for the moment, when a file is created, its access permissions are more dependent on the environmental settings of the process than the permissions on the directory where it is due to be located. The process's 'umask' dictates what file permissions are given to a newly created file. The permissions on the directory only dictate whether the file can be created or not (and the file doesn't usually inherit permissions from the directory it has been placed in). Using the 'setgid' permission can affect the ownership of files.
For more information see the 'man pages' for:
umask acl setgid
and the file: /etc/default/login
Used umask on /etc/default/login will apply for all directory.
But I want few directories not all.
Everytime users created files on /test/test1/files automatically have a right access 775 not 755. My environment is mixed solaris and linux.
Thanks
I am still not sure what you are asking (and what you are trying to achieve). The 'umask' can be changed during a 'login session'. It may be the time to stop ignoring ACLs. Have a look at the man pages for 'setfacl' (and 'getfacl') and then experiment to see if ACLs help. You may even find that using the 'sticky bit' gives you what you are looking for.
I definitely recommend ACLs for this purpose (if the filesystem you are using supports them). I only wish they were more widely supported by other OS, filesystems and backup utilities.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.