V
V
Viktor Yanyshev2017-09-29 10:27:23
Apache HTTP Server
Viktor Yanyshev, 2017-09-29 10:27:23

How to set permissions on a directory so that files are created with the owner's group?

There is an installed Apache running from www-data . The /var/www directory has two directories:

drwsrwsr-x  user_1:user_1  ./dir1 
drwsrwsr-x  user_2:user_2  ./dir2

The www-data user is in the user group user_1 and user_2 . And the users themselves are not in the www-data group .
When a file is loaded through the site admin panel, it turns out:
www-data:www-data  /var/www/dir_1/cms-file-test  # Почему  группа www-data  а не user_1?

via ssh:
root# > /var/www/dir_1/root-test
root:user_1  /var/www/dir_1/root-test # Группа user_1 как надо

user_2$ > /var/www/dir_1/user_2-test # Доступ запрещён, всё как надо

How, when uploading files from (via Apache) the site control panel, set the directory group on the files and not www-data?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question