(I'll link to other answers that I read next) I've installed LAMP stack, and I'm trying to put files in /var/www/html

 nati@nati-pc:/var/www/html$ touch example
 touch: cannot touch 'example': Permission denied

I changed the permissions to www folder

 nati@nati-pc:/var$ ls -al
 drwxrwxr-x  3 www-data www-data 4096 Oct 29 20:40 www

also to html:

 nati@nati-pc:/var/www$ ls -al
 drwxrwxr-x  2 www-data www-data 4096 Oct 29 20:40 html

I added my self to www-data group:

 nati@nati-pc:/var/www$ awk -F':' '/www-data/{print $4}' /etc/group

As you can see the group permissions of www & html are 7 and I'm in the group so I don't understand why can't I write to the folder.

I followed this answer (https://superuser.com/questions/278446/ive-set-up-apache-but-i-cant-write-to-the-var-www-folder#=)

Ubuntu 18.04


So, thanks to Shimi I checked with id command if the group includes me and it didn't so I needed to log in using sudo su nati and then the id command showed me that I'm in the group and since then I can edit the files.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.