0

I want to create a directory, for instance testing-data on CentOS 6.5 Linux version, and have read,write,execute to all the sub-folders and sub-sub-folders and files within them to everyone(all users), not to any specific group. In fact, whenever a new file is written into any of these sub-folders without using chmod 777 the new file should be able to be accessed by any user.

Is this possible?

muru
  • 72,889
  • 1
    World writable (and executable!) files, while possible, are generally undesirable, as they present a significant security risk to all users on the system. What is the use-case for this requirement? – Thomas N May 11 '16 at 20:38
  • @derobert the question or the answer? The answer covers both g+s and ACLs, and the question doesn't know about g+s. – muru May 11 '16 at 21:19
  • @muru Oh! It does, somehow I missed the ACL discussion in the answer. It is indeed a duplicate then. – derobert May 11 '16 at 21:32

1 Answers1

1

Yes it is possible. umask or setfacl both can do this.

sudo mkdir /everyone                #create the folder   
sudo chmod 777 /everyone            #to grant access for everyone to the folder
sudo setfacl -m d:m::rwx       #set file access control list

Added the d option to set default ACL - all the new files will have the default permissions.
And umask can help as well.

magor
  • 3,752
  • 2
  • 13
  • 28