1

On linux, the base permission for a file is 666 and for directories, it is 777. With a umask=022, new files and directories have permissions 644 and 755 respectively.

When I mount a usb drive with umask=022, new files and directories both have permissions 755. Why is that so?

Gradient
  • 3,659

1 Answers1

0

On a vfat file system no real unix rights are stored. Thus umask blocks from the maximum rights possible. If a file is created then the creating process usually does not set execute bits but the file system cannot store this information (thus has to assume that these bits are set).

You can use dmask and fmask to set different values for files and directories. But you will not be able to execute files (directly) then.

Hauke Laging
  • 90,279