My apache webserver runs as user
www-data and is in the groups
I have created a subscription in plesk. All files from all domains in this description are owned by user
karl and group
I have logged in via ssh to my server and called a script as user
root:root. The script created a file
content.json also as
root:root with access rights
On my website, visitors are allowed to change the content of the file
content.json through my website(a php script). However, the script returns
failed to open stream: Permission denied.
I changed the user of
karl:psacln and to my surprise, the script can now write to the file.
Why does my script has access to the file? Apache runs as user
www-data not as
karl. Read rights are only given to the user.