0

I have a folder and I have set GID on it like this:

chmod -R g+s

I also set r/w perms like this:

chmod -R 2774

But the problem is that newly created files inside this folder do not keep 2774 permissions so the GID is useless for me because I need write permissions for the group as well.

The problem is: I have an application, that is running under certain user, and than there is couple of admins, who might edit (or upload new) application's files, but when they do edit/upload them, the application does not have write access to them. Is there any way how to make sure that all newly created or edited files inside 1 folder will always keep 2774 permissions ?

0

You can have a umask problem. When a user application sets the access flags on a file, the flags given by the application are restricted by the user's umask. For instance most applications set universal access to files they create, but the usual user's umask resets the group-write and others-write flags. So you would have to set a more permissive umask for the admin ids.

1
  • Well, even when I create a new folder, as a root for example with mkdir command, it does not keep write permissions.The problem would be solved even if there is a way how to set that new files will not only inherit group but will change the ownership as well ? It something like this possible ? I mean, I create a new folder as a root and the owner will be the one from parent dir ? – Dakado Feb 5 '20 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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