M
M
Magzhan Birgebayuly2016-11-08 09:57:51
SSH
Magzhan Birgebayuly, 2016-11-08 09:57:51

How to correctly distribute accesses in ubuntu 16.01 server?

There are directories /var/www/site1 and /var/www/site2 .
1) You need to make it so that user1 can do anything in the /var/www/site1 directory , and user2 in /var/www/site2 , but do everything so that user1 cannot view files in the /var/ directory www/site2 and the same with user2 .
2) With all this - so that nginx can read data from both directories.
The first one worked for me, but now Nginx cannot access the directory and the site crashes...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
Ulrich, 2016-11-08
@henhanshi

It's easy:
1) so that user1 can do anything in the /var/www/site1 directory
Assign him as the owner of the directory and give rights only to the owner, remove the rest. Similarly with user2
2) so that user1 cannot view files in the /var/www/site2 directory
This is solved by point 1
3) Assign the Nginx user to some of your groups (if he does not have his own) and modify points 1 and 2 to give rights to this group as well. Because user1 and user2 will not be members of this group, these permissions will not work for them

S
Saboteur, 2016-11-08
@saboteur_kiev

Set user1 as the owner of /var/www/site1
Set user2 as the owner of /var/www/site2
Set a group for both directories, for example, and add the user under whose name your nginx is launched (maybe such a user and group already exist).
Set permissions to 770 (rwxrwx---) on both directories so that owners and groups have full access.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question