I have been struggling for hours with an annoying permissions issue (feel like it's ALWAYS permissions that's holding me back).
I am trying to ensure that I can create/read/execute inside /var/www/html
. The folder is owned by www-data
. My user is a member of the www-data
-group. My deployment service is also a member of www-data
. So I cannot change ownership to my own user since we're multiple users who need to have access to the folder.
I have tried the following:
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 775 /var/www/html
sudo usermod -a -G www-data my_user
groups my_user #verify that I am a part of the group
Still if I try to create a folder within /var/wwwhtml/
folder I get: Permission denied
I am stuck! It seems a though multiple people have been facing this issue before, some solutions require to change ownership to my current user, but that's not what I want. I want www-data to own the folder. Also I need multiple people to be able to write in the path.
usermod
command? Assuming you are logged in asmy_user
, you should see different outputs fromgroups
andgroups my_user
before relogin.