2

It seems I need to use sudo to ls directories that I own and have r/w permissions on.

If I try to ls my media drive, I can see it, but not its sub-directory, even though I think owning that sub-directory should enable me to do so. When I try, I get this result:

me@icvr1:/home$ ls -al /media/
total 12
drwxrwxrwx   3 root              root      4096 Dec 20 11:05 .
drwxr-xr-x  25 root              root      4096 Dec 19 12:41 ..
drw-rw-rw-+  4 me                me        4096 Jan  4 12:01 innovationcommons

me@icvr1:/home$ ls -al /media/innovationcommons/
ls: cannot access '/media/innovationcommons/External_Storage': Permission denied
ls: cannot access '/media/innovationcommons/DataStorage': Permission denied
ls: cannot access '/media/innovationcommons/..': Permission denied
ls: cannot access '/media/innovationcommons/.': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
d????????? ? ? ? ?            ? DataStorage
d????????? ? ? ? ?            ? External_Storage

me@icvr1:/home$ ls -al /media/innovationcommons/DataStorage 
ls: cannot access '/media/innovationcommons/DataStorage': Permission denied

However, if I use sudo, I get this more expected and useful result:

me@icvr1:/home$ sudo ls -al /media/innovationcommons/
[sudo] password for me: 
total 16
drw-rw-rw-+ 4 me     me     4096 Jan  4 12:01 .
drwxrwxrwx  3 root   root   4096 Dec 20 11:05 ..
drwxrwxrwx  1 me me         4096 Jan  3 13:35 DataStorage
drw-rw-rw-  4 me me         4096 Aug 29 11:33 External_Storage

me@icvr1:/home$ sudo ls -al /media/innovationcommons/DataStorage 
total 16
drwxrwxrwx  1 me me 4096 Jan  3 13:35 .
drw-rw-rw-+ 4 me me 4096 Jan  4 12:01 ..
drwxrwxrwx  1 me me 4096 Jan  2 16:08 Images
drwxrwxrwx  1 me me  496 Jan  3 13:37 Places
drwxrwxrwx  1 me me    0 Dec 12 14:53 $RECYCLE.BIN
drwxrwxrwx  1 me me 4096 Dec 12 14:54 System Volume Information

Why can't I successfully ls -al /media/innovationcommons without using sudo, or even just ls its sub-directories?

  • The purported duplicate question does not address the case of a directory, as here, that has an access control list. – JdeBP Jan 04 '18 at 23:00

1 Answers1

4

You don't have execute bit of the folder.

The execute bit of the directory allows the affected user to enter the directory, and access files and directories inside

See also: Execute vs Read bit. How do directory permissions in Linux work?

Ben
  • 156