G
G
German Zvonchuk2015-10-13 16:17:44
linux
German Zvonchuk, 2015-10-13 16:17:44

NGINX - how to give multiple users SSH access to /home/domain/www on the same domain?

Good day.
I have a Debian Jessie server with NGINX 1.8.0 installed with which I distribute static files.
Current situation:
Domain: static.domain.com
Let on server: /home/static/
Owner: ustatic:ustatic
Let on server: /home/static/www/
Owner: www-data:www-data
and all other files on the server in the /home/static/www/* directory
Problem:
If I change the ownership of the ~/www/ folder or any file in that folder, I immediately get the "NGINX 403 Forbidden" error.
Task:
My problem is that I have two folders in the ~/www/ directory, for each of which I have to create one account. So that each user via SSH / SFTP has access only to his own folder.
~/www/dirone userone
~/www/dirtwo usertwo
And at the same time, so that NGINX can safely distribute these files to static.domain.com/dirone/ and static.domain.com/dirtwo/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
ldv, 2015-10-13
@ldvldv

/home/static/www/dirone
owner: userone
group: www-data
permissions: rwxr- s ---
/home/static/www/dirtwo
owner: usertwo
group: www-data
permissions: rwxr- s ---

G
German Zvonchuk, 2015-10-13
@inside22

The only solution I found was to create directories:
/home/userone/
/home/usertwo/
and two users:
userone
usertwo
and then link:
ln -s /home/userone/ /home/static/www/userone
ln -s /home/usertwo/ /home/static/www/usertwo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question