1

I was going through my old code and I stumbled upon some strange behaviour.

Folder and files inside it are chowned to me, however I am not allowed to enter it,
or even list its content. Unless ofcource I am a root user.

Here is a screenshot. Could you please explain ? file listing allowed when sudo, but not to regular user

GNU coreutils : 8.25,
OS : Ubuntu 16.04.2 LTS

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
prashant
  • 115
  • 2
  • 5

1 Answers1

4

Directories must have executable bit set to be "searchable". That includes listing contents as well as entering them with cd. Try chmod +x on the Scripts dir, for example. This is different from regular files where executable bit allows them to be executed (of course).

More information here: Execute vs Read bit. How do directory permissions in Linux work? and In Linux, "Write" Permission Is Equivalent To "Execute" For Directories?

B Layer
  • 5,171
  • Thank you very much, I didn't know that. But why is it so can you explain I didn't understand why +x required for cd. – prashant Jul 02 '17 at 05:01
  • Sure. I added some links to my answer that go into this. Lots of other people have been thrown off by this behavior. But it makes sense once you get used to it. – B Layer Jul 02 '17 at 05:09