Defaulting file permissions for any file being kept in a specific folder

0

I'm Using AIX.

I have a folder owned by me. Permissions for the folder are 777.

That means anyone can keep their files in this folder.

But I want the files to be kept only with 777 permissions. But people are keeping files with lesser permissions making it unreadable for others.

Is there any way of making all file inside folder with 777 permission automatically?

nitgeek

Posted 2013-07-04T10:46:46.020

Reputation: 121

Answers

1

You can't set umask values for specific folders. You could set it system-wide by adding a umask command to /etc/profile or /etc/bash.bashrc but that is not a good idea if you want to set permissions to 777.

If the folder in question is a separate, mounted filesystem, you might be able set a umask for it in the /etc/fstab. This depends on the filesystem used though, according to man mount the umask (or equivalent) option is available for FAT, hfs, hpfs, ntfs and udf.

In all other cases, your best bet would be to set up a cron job that recursively changes the folder's permissions to 777. Add this line to /etc/crontab:

* * * * * root chmod -R 777 /path/to/dir

terdon

Posted 2013-07-04T10:46:46.020

Reputation: 45 216