-1

I use fuse to mount some directories on Ubuntu. The user should have rwx on directories and rw- on files.

Now doing this with setfacl is quite easy. Doing setfacl -R -d -m u::rwX,g::rwX,o::--- dir/ does the job perfectly fine.

But how to do this with umask?

Aley
  • 8,540
  • 7
  • 43
  • 56

1 Answers1

0

What you should know about umask first is that umask is a mask; it is not a number to be subtracted. It turns off permissions that would normally be granted. Masking is not the same as subtracting, e.g. 666 masked with 001 is still 666 and 666 masked with 003 is 664. The mask turns off permission bits. If they are already off, the umask makes no change.

Make sure you are in the directory you wanna assign permissions to and do the following:

this link answers exactly what you're looking for!

https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html

hope this helps.

Ghassan Zein
  • 4,089
  • 3
  • 19
  • 30
  • You mean `umask u=rwX,g=rwX,o=`? That results in an invalid parameter. – Aley Dec 08 '17 at 10:02
  • well I used to use 'umask u=rwx,g=rwx,o=rx' and it worked fine for me.. Tested on ubuntu all versions – Ghassan Zein Dec 11 '17 at 12:23
  • the full process was using this: "`sudo setfacl -dR -m u:dev1:rwx,g:www-data:rx,o::rx /directoryName`" "`sudo chmod g+w /var/www/DirectoryName/Folder/`" "`umask u=rwx,g=rx,o=rx`" – Ghassan Zein Dec 11 '17 at 12:31