My Apache web server is running as a user
www-data and is in the groups
I have created a subscription in plesk. All files from all domains in this description belong to the user
karl and group
I logged in to my server via ssh and called a script as a user
root: root, The script has created a file
content.json as well as
root: root with access rights
Visitors to my site are allowed to change the content of the file
content.json through my website (a php script). The script returns, however
Stream could not be opened: permission denied,
I changed the user from
karl: psacln and to my surprise, the script can now write to the file.
Why does my script have access to the file? Apache runs as a user
www-data not as
karl, Read rights are granted to the user only.