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?


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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