Sample Header Ad - 728x90

Can www-data control root files on Ubuntu web servers?

0 votes
1 answer
700 views
I have read about a bazillion posts about how to set up web server ownership, directory, and file permissions. I have heard use root. Don't use root, use www-data. Don't use that, use a different user for each website. Yada, yada, yada. I decided to use root instead of www-data. I know the risks. I limit them by only allowing shell access from my IP and I have a password that would take a long time to break. I do more things but that isn't the question here. I want to show you my present tree structure. All of my hosted domains use a similar format. I'll ask a question in just a moment, but take a look:
├── [drwxr-xr-x www-data www-data]  www.website.com
│   ├── [drwxr-xr-x root     root    ]  css
│   │   ├── [drwxr-xr-x root     root    ]  font
Everything under the domain is at root ownership. What puzzles me is the www-data ownership of the folder. Questions: Can the domain line permissions allow someone to override the root ownership of files below that line? Should the domain line be set to root root?
Asked by DontAsk (1 rep)
Aug 15, 2023, 03:49 AM
Last activity: Aug 15, 2023, 11:59 AM