Crazy Permissions
-
I have numerous web sites hosted on an AWS Amazon Linux Lightsail VM. A couple of my customers would like access to directly make changes to their files. The majority just want me to handle everything. I’d like to add a user that my customer(s) can use, that can only read/write to their site and not even see the others. I currently do the following to set permissions on a site with this script:
#!/bin/bash sudo chown -R $2.www $1 sudo chmod -R 0775 $1 find $1 -type d -exec sudo chmod 0775 {} \; find $1 -type f -exec sudo chmod 0664 {} \; #executed at the command line like sh script.sh /var/www/html/somesite.com apacheThat sets the owner of the files to Apache and the group to www.
I would like to change the owner to another user and give my customer access. So I create a user following these instructions: https://aws.amazon.com/premiumsupport/knowledge-center/new-user-accounts-linux-instance/ I use this script to assign the permissions to a user named ‘somesite’ like
sh script.sh /var/wwww/html/somesite.com somesitePermissions:
drwxrwsr-x somesite www ....somesite.com
Which, should mean that somesite is the owner and the www group, which includes Apache, has g+w.Here is where the really crazy stuff starts. Using that new username+key file, I can upload media via WordPress, I can upload files via SFTP but I can’t install any plugins via the WordPress admin. WordPress prompts me to enter the FTP information, typical if you have the permissions screwed up.
Permissions on ‘plugin’ directory is identical to ‘uploads’.
Link to the stackoverflow question: https://stackoverflow.com/questions/49122080/permissions-on-multi-tenant-hosted-server-on-amazon-linux-for-wordpress
Anyone got any ideas how to even troubleshoot this?
The topic ‘Crazy Permissions’ is closed to new replies.