I have a script that runs in aws which basically pulls data feeds via api then creates a folder which it then dumps a csv file into. Right now it is supposed to name the directory based on its name. It does create the folder but rather than creating it with inherited permissions it creates it with read only access and therefore cant dump the csv file. Now I can easily run chmod 755 on the folder and ill be fine, but I have thousands of folders to do and that will be a bit monotonous.

  • What is the value of the user mask? Did you try to change it?
    – xenoid
    Jun 27, 2020 at 6:10
  • 377 - yes I can change it manually but this will be a big pain if I have to do it for every single one of them Jun 27, 2020 at 7:07

1 Answer 1


A value of 377 (or is that 0377) for the user mask is unusual to say the least, it resets all the access flags and only leaves read access to the file owner (if even resets the execute flags, making directories unusable even by their owner).

The usual umask values are

  • 0002: full r/w access to user and group, R/O access for others
  • 0022: full r/w access to user only, R/O access for group and others
  • 0077: full r/w access to user only, no access to others

To change the umask you just add a umask command in your ~/.profile but it is also possible that said ~/.profile already has a umask 0377 command, that you just need to change or remove.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .