Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied for a "drw-r--r--" directory

Tags:

unix

debian

I have a log/ directory with read permission for all : drw-r--r--

paul@ns387656:/var$ ls -l
...
drw-r--r--  9 root     root  4096 May 22 14:49 log
...

But when I want to access it with the cd command I have a "Permission denied"

paul@ns387656:/var$ cd log
-sh: cd: log: Permission denied

And I don't know why...

Ideas ?

Thx

like image 827
Paul Avatar asked Feb 12 '23 22:02

Paul


1 Answers

You need execute permission to change into a directory. Also the owner is listed first. In this case the owner is root and root has read and write permission. Group and Others have only read permission.

Try this:

sudo chmod a+rx log

This adds read/execute permission for owner, group, and others.

like image 105
John C Avatar answered Feb 15 '23 11:02

John C