Answer the question
In order to leave comments, you need to log in
Linux users and groups: how to do it right?
Help me clean up my head, I can't figure out how to properly and safely set up a VPS. The question is about permissions and groups, I want my site to be in the /home/danforth/www/ folder (am I thinking right?)
To do this I create a new user and give him a password
sudo useradd danforth
sudo passwd danforth
Answer the question
In order to leave comments, you need to log in
"755 for files
644 for folders"
vice versa for folders (755 - rwxr-xr-x), Otherwise, no one will be able to access the folders, and for files 644 (rw-r--r--)
"nginx so that he looks into this directory
Why? If it is not running from your danforth, then you do not need to do this, let nginx look in its directory. But the user danforth can be added to www-data so that you can go there and write, and yes, then you will need 775 and 664, respectively.
The rights should not be, the rights can be different, you just write down who and where should have access and assign. When installed, these services often create the necessary users on behalf of which they run. Adding and changing permissions usually goes through groups, not through the owner.
i want my website to be in /home/danforth/www/ folder
Why, sorry? The danforth user's home directory is intended for danforth user files - including settings for various systems. Some files can store information that is very curious for outsiders. It's like placing a file in the user's profile directory on Windows.
Sites that are not related to the danforth user are best placed outside the user's home directory, such as /var/www (as is usually done in Linux) or /usr/local/www (as in FreeBSD).
mysql runs from the mysql user, I don't know the rest - I have apache :) working - all of a sudden - from the apache user :) There is also ruby, the passenger module works from the nobody user
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question