0

I have created a user that I called netbean

Netbean is part of three group:

  • netbean (obviously),
  • www-data (that is the group the apache server runs under)
  • sudo (to have the sudo rights just in case).

I use it to manage the upload of files from my laptop (where i develop) to the webserver.

Issue is that if I try to cd to /var/www/html as netbean i get a permission denied. /var/www/html is modded at 665 and is owned by www-data:www-data.

I don't understand why I get a permission denied since it is read and write for www-data and for the users in the www-data group

  • 1
    Directories need to get executed to enter them. You need 775. – pLumo Oct 22 '18 at 14:25
2

Directories need executable permission to be able to enter them. Use 775 instead of 665.

mkdir dir
$ stat -c %a dir
755
$ cd dir #this works
$ cd ..
$ chmod 655 dir
$ cd dir
bash: cd: dir: Permission denied
| improve this answer | |
0

You have to edit the permissions of your directory/file, inorder to access/edit it. If your directory name is 'example',

$sudo chmod a+x example

If your file name is 'filename.ext' where 'ext' is your extension,

$sudo chmod a+x filename.ext
| improve this answer | |

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.