Write permission in /var/www/html for my user

I am trying to grant my user write permission to the /var/www/html directory. I have executed so far:

# sudo usermod -aG www-data $USER
# sudo chown -R www-data:www-data /var/www/html
# sudo chmod -R 775 /var/www/html

This, in my opinion, should suffice, but unfortunately, I still can't overwrite the files in the web directory or create new files there. If I execute id I don't see that my user user1 belongs to www-data:

# id
uid=1001(user1) gid=1001(user1) groups=1001(user1),27(sudo),110(lxd)

but if I execute it defining the user I see that my user belongs to group 33 (www-data)

# id $USER
uid=1001(user1) gid=1001(user1) groups=1001(user1),27(sudo),33(www-data),110(lxd)

The groups command is also not showing that I am part of the www-data group.

# groups
user1 sudo lxd

I am totally lost here, what I am doing wrong and why I still can't overwrite the files in the /var/www/html directory?

5 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like