Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create files on specified directory with right access 775

Status
Not open for further replies.

ady2007

IS-IT--Management
Oct 3, 2007
22
ID
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


I hope that helps.

Mike
 
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 hope that helps.

Mike
 
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.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top