skip to Main Content

i am currently trying to get wordpress running on Ubuntu Server 18.04 with apache. I managed to get everything to work, but for some reason i am not able to use ls -l properly anymore on the wordpress directories, in which i played around with permissions. The out-of-the-box permissions didn’t allow me to update my themes from the wordpress webinterface.
I can’t find a solution to this problem, because the permissions are clearly stating, that i have at least read permission.

Problem: ls -l shows question marks and sais permission denied.

Infos: permissions are rwx for owner www-data, rw for group www-data and r for other. Output of groups includes www-data, so the user should be in the www-data group.

Outputs:

$ ls -l /usr/share/wordpress/
ls: cannot access '/usr/share/wordpress/readme.html': Permission denied
...
ls: cannot access '/usr/share/wordpress/wp-comments-post.php': Permission denied
total 0
-????????? ? ? ? ?            ? index.php
...
-????????? ? ? ? ?            ? xmlrpc.php
$ groups
*censored user* adm cdrom sudo dip www-data plugdev lxd lpadmin
$ sudo ls -l /usr/share/wordpress/
total 172
-rwxrw-r--  1 www-data www-data   418 Apr  6  2018 index.php
-rwxrw-r--  1 www-data www-data  7440 Apr  8  2018 readme.html
-rwxrw-r--  1 www-data www-data  5697 Apr  8  2018 wp-activate.php
drwxrw-r--  9 www-data www-data  4096 Jul 20 00:53 wp-admin
...
-rwxrw-r--  1 www-data www-data  3065 Apr  6  2018 xmlrpc.php

P.S.: Any extra tips for wordpress security are useful.
Thanks

edit forgot the permissions of the directory, still confusing.

$ sudo ls -l -a /usr/share/wordpress/
total 180
drwxrw-r--   5 www-data www-data  4096 Jul 20 17:13 .
drwxr-xr-x 162 root     root      4096 Jul 20 02:40 ..
...

2

Answers


  1. set execute bit permissions for group you belong to.

    Login or Signup to reply.
  2. To list a directory’s content, you have to have "execute" permission for that folder. And you don’t have it for /usr/share/wordpress/ – only "www-data" user (not the group) does.

    You don’t have to make the file executable, just the directory. The following will help you:

    $sudo chmod -c 774 /usr/share/wordpress/
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search