0

There is a fundamental aspect of the way permissions work in linux directories I think I have not understood.

I have this folder I was trying to access from my local apache server :

sudo chmod 777 /home/ut/programmes/Programmation/p5-linux/
sudo -u www-data ls /home/ut/programmes/Programmation/p5-linux/
ls: cannot read directory '/home/ut/programmes/Programmation/p5-linux/': Permission denied 

Why is it not working ? even though the permission is 777 ?

Moreover, by doing :

sudo chown ut:www-data /home/ut
sudo chmod 710 /home/ut

without changing anything to the permission in /home/ut/programmes/Programmation/p5-linux/, now this is what I get :

sudo -u www-data ls /home/ut/programmes/Programmation/p5-linux/
icudtl.dat  libffmpegsumo.so  locales  nw.pak  p5  p5.png  Projets

the only thing I did was to change the group of a parent dictory. why does it work now ?

Albizia
  • 201

1 Answers1

0

On your first try you have all permissions to the last directory only:

/home/ut/programmes/Programmation/p5-linux/

But you need to have "execution" permission to all parent directories. From what you add, we understand that you dont have execute on /home/ut. Note that you dont need to have read permission to parent directories.

In your second try you have found that you need only execute permission (and not read)

Arno Bozo
  • 131