1
  • In Debian I have a user called jesse
  • I have a group called www-data for Apache2
  • I have a folder called /htdocs
  • htdocs belongs to user:group of www-data:www-data

I do not understand why the user jesse cannot overwrite files in the directory when he belongs within the www-data group.

Can anyone please let me know what I am missing?

$ groups jesse
jesse : jesse sudo www-data
2
  • 1
    what is mode for directory /htdocs? i.e. what does ls -l htdocs show?
    – mvp
    Nov 17, 2013 at 8:33
  • -rw-r--r-- 1 www-data www-data 395 Sep 21 02:56 index.php
    – JREAM
    Nov 17, 2013 at 19:35

1 Answer 1

1

If your user jesse is member of group www-data, then to be able to create new files (and edit/delete existing ones) in directory /htdata that directory must have group write permission enabled (your current setup does not!). In other words, ls -ld /htdata should show:

drwxrwxr-x 1 www-data www-data 395 Sep 21 02:56 /htdata

and ls -l index.html should show:

-rw-rw-r-- 1 www-data www-data 395 Sep 21 02:56 index.html

You can fix your permissions using this command:

chmod -R g+w /htdata

which means give group write permission (g+w) to directory /htdata and all content under that directory recursively (-R).

0

You must log in to answer this question.

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