S
S
snchz2021-03-13 09:59:27
linux
snchz, 2021-03-13 09:59:27

How to properly organize rights and user groups on a web server with several people?

Good day!

I have such a problem, which for some reason was previously solved without any problems

. There are 3 users on the server - user, eagle, ws

User / Group on whose behalf php works - web

Each user can deploy to his test subdomain on the site.
deploy goes like this:
- a new folder is created
- The git clonerepository is executed in this folder
- shared directories are pulled up by Symlinks.
- Run custom tasks before launching
- On the current folder, which is root for nginx, put a symlink to a new folder.

So, the problem itself:

Git can only set 0644rights or 0755, the group will not be able to write, only the user himself, and the files havechown user:weband сhmod 755- after deployment.

The script crashes when you try to write something to a file, since php works from web:web, and files user:web

I tried to make a custom task that adds the group the right to write to files, and insert it into the deploy chain.

But even here a problem crept in:

- the files that are created by the script (sessions, cache, logs) - they have chown web:weband from under user I can’t change chmod to them, the task crashes.

Now user, eagle, wsin a groupweb

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanes, 2021-03-13
@snchz

user:user
php must run as user. One host - one user.

A
Anton Shamanov, 2021-03-13
@SilenceOfWinter

put everyone in the same group or let the web change to indicate the group the developers are in - chgrp()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question