0

I'm the owner of a folder, yet I cannot cd into the folder.

After some searching I discovered that you need execute permission to cd into the folder.

I then did:

sudo chmod u+w myfolder

To add execute permission for my user. Yet I still cannot open the folder.

Zanna
  • 72,312
panthro
  • 286
  • 1
  • 5
  • 14

1 Answers1

3

The command you entered

sudo chmod u+w myfolder

grants write permission to the owner... There it is:

drw-r--r-- 13 myuser www-data
  ^--owner may write

You wanted execute permission

chmod u+x myfolder

(you won't need sudo if you own it). That will give you

drwxr--r-- 13 myuser www-data
   ^--owner may enter and search

(octal 744) - but there's not much point in that setting - probably you either want 755 (all can access) or 750 (owner and group can access) or 700 (only owner can access), since read permission for directories isn't much use without execute permission.

Zanna
  • 72,312