Ubuntu – automatically set sudo chmod 777

chmodpermissions

is there a way to automatially set sudo chmod 777 for all the files, folder and subfolders in a directory. The sudo chmod 777 should automatically be set when a folder or a file is created in the parent directory.

Is there a way to do that?

Best Answer

In bash execute umask 000 and then every directory you create will have permissions 777 and every file you create will have permissions 666. You can't create executable files by default, you need to explicitly make them so using chmod. It is a security feature.

Note that the umask is "bitwise xor" of the desired file permissions and to get the most permissive mode of 777 you need to use umask 000.

In recent Ubuntu systems you set the systemwide umask in file /etc/login.defs. Older systems use /etc/profile.

Please do have in mind that people who create operating systems know a thing or two about security and have chosen umask 022 for a reason. You will make your computer quite insecure if you follow this advice.