1

I'm using umask in fstab settings. What I know is if i set 755 with chmod, the permission will be rwxr-xr-x. But, when I use umask in fstab with 755 value, permission that i get is ----w--w-. Giving 0755 doesn't seems to work.

Is there any difference between those two?

And how to give rwxr-xr-x permission with umask in fstab?

0

2 Answers 2

3

You can think of umask as somewhat opposite to permission.

By default Ubuntu uses the base permission of 777 for a directory and 666 for a file. By deducting the umask value from the base permission you get the applied permission of a newly created file/directory.

In your case, you have given the umask as 755. Now as the base permission for directories is always 777, what the applied permission we get:

777 - 755 = 022 i.e. ----w--w-

To get your desired permission (755), you need to put the umask as 022.

0

You can also use umask for user as umask u=rwx accordingly for group and other, in case you want to use umask and not chmod.

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