I
I
iliyaisd2018-07-23 00:48:16
linux
iliyaisd, 2018-07-23 00:48:16

How to properly give write permissions to two users in Linux?

There is a project on Symfony 2, which is deployed using Jenkins (works as a jenkins user). The project is running under nginx (running as www-data user). With each deployment, you need to clear the project cache using the Symfony command:

php app/console cache:clear --env=prod

To do this, the jenkins user must have write access to the app/cache and app/logs project directories.
In addition, when deploying, jenkins copies the entire app folder, in which there is a pre-created logs folder under the git, so it overwrites it and becomes the owner. The build fails if jenkins cannot write to these folders.
Nginx must also have full rights to these two folders, Symfony crashes.
The question is how to solve this problem correctly so that both users have full access to both folders?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
CityCat4, 2018-07-23
@iliyaisd

adyn method:
create a group mygroup, give the group write permissions, add to it all users who need the right
dfa method:
add write permissions to each user via setfacl. The method is usually used when the first method is not applicable (since exactly one group can be used in it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question