0

When files are created in my webapps folder (tomcat) they are write protected by default. Is there any way to prevent this? I would like a program I have written to be able to create and delete this file (naming it the same thing) but I believe this is preventing it from working.

1 Answer 1

2

You basically have two options:

  • Set the umask to allow writing by default: umasks are a mask on the permissions. Just subtract the umask value from 777. So umask 022 means that new files will be created with default permissions of 755. This will be activated for all new files created.

  • Use an ACL on the directory: while the umask is valid for all files created (on that filesystem), an ACL can be set on a specific user. Use the following examples:

set the default permissions for the group on read, write, execute in /folder

# setfacl -d -m g::rwx /folder 

set the default permissions for others on read and execute in /folder

# setfacl -d -m o::rx /folder

You must log in to answer this question.

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