For directories, severals references say:
- r: we can list directory contents
- w: we can write on directory
- x: we can change to directory (cd into directory).
But in my tests I got following situation:
- my user mateus applies to others permission.
- x is the directory
r permission for others (
If I issue ls -l in directory I got this crazy output:
mateus@engsrv:/tmp$ ls -l x/ ls: cannot access 'x/file_teste': Permission denied total 0 -????????? ? ? ? ? ? file_teste mateus@engsrv:/tmp$
I can't "cat" the file as well.
mateus@engsrv:/tmp$ cat x/haha cat: x/haha: Permission denied
Ok, let's se what happen only with
w permission for others (
mateus@engsrv:/tmp$ touch x/file_test2 touch: cannot touch 'x/file_test2': Permission denied mateus@engsrv:/tmp$
If I grant execute (
chmod 703), I can write to the folder:
mateus@engsrv:/tmp$ touch x/file_test2
The same happens to read permission (
mateus@engsrv:/tmp$ ls -l x total 4 -rw-rw-r-- 1 mateus mateus 0 Oct 3 17:45 file_test2 -rw-r--r-- 1 root root 3 Oct 3 17:31 file_teste
So, execution (x) is always necessary? but why? is there something else that need execution permission in background?