0

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.

1
  • 1
    Well have you re-login after the usermod command? Assuming you are logged in as my_user, you should see different outputs from groups and groups my_user before relogin.
    – Tom Yan
    Commented Sep 24, 2019 at 17:58

1 Answer 1

1

You may have to re-login for the changes to take effect (after adding a user to a group)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .