Search code examples
ubuntupermissionsmkdir

Lacking permissions to create folder in var/www


I have recursively changed ownership of my www folder and everything in it to www-data:www-data. I am using the ubuntu user and have added myself to the www-data group and rebooted the server. I am getting the following error:

mkdir: cannot create directory 'dir_name': Permission denied

I can sudo mkdir, but from research it seems that if I have the right permissions then I should not have to sudo for mkdir. So I clearly lack the permissions, but I am not sure why, if I am in the correct group, as I am.


Solution

  • Your group needs to have write permissions to your www directory.

    Right now you have rwx for the user than r-x for group and r-x for other.

    You need to chmod g+w