Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a directory "dir1" who's owner is "owner1" and it has 775 permissions.

Another user in the same group as "owner1" is called "owner2"

Whenever a file is written to "dir1" by "owner2" I need the permissions to be 600, and if it writes a directory, I need it to be 700.

How can I do this? Do I need a UMASK?

share|improve this question

1 Answer 1

If the "owner2" will have umask 077 it will clear group and other permissions from the list for all files created while this is set. The problem of course would be that "owner1" won't be able to read those files.

If there is a specific program that creates files in "dir1" then the shell from which this program has been started can have umask 077 set for it.

Example

umask 077 ; ./start_creator_owner2

If this line is part of the start script then the everything created by start_creator_owner2 will have go permissions of 0.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.