1

I wanted to access files php5 folder on \var\lib\php5, but I got permission denied. I use Ubuntu 14.04 LTS. Is it Ubuntu lock the permission for the folder and need root access? Your help and information is great appreciated,

Regards,

Iccsi

3
  • Could you post which command you did and namei -mo /var/lib/php5 command output?
    – Lety
    Commented Sep 20, 2014 at 22:47
  • myuser@mymachine:/var/lib$ cd php5 myuser@mymachine:/var/lib/php5$ ls ls: cannot open directory .: Permission denied Commented Sep 21, 2014 at 3:49
  • myuser@mymachine:/var/lib/php5$ namei -mo /var/lib/php5 f: /var/lib/php5 drwxr-xr-x root root / drwxr-xr-x root root var drwxr-xr-x root root lib drwx-wx-wt root root php5 Commented Sep 21, 2014 at 3:50

1 Answer 1

0

As you can see, command namei -mo /var/lib/php5 output is:

     drwxr-xr-x root root / 
     drwxr-xr-x root root var 
     drwxr-xr-x root root lib 
     drwx-wx-wt root root php5 

php5 folder permission drwx-wx-wt means:

  • drwx this is a directory and the owner (root) has read, write and execute permission
  • -wx users in root group have write and execute permission, they can't read
  • -wt other users have write and execute permission, but can't read. t also tell that this folder can be removed only by the owner

If you want to read this folder you need root privilege, so try this command:

     sudo ls /var/lib/php5

According to sudo manual:

sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.

Be careful to use sudo command, because gaining root permissions, you can do anything and if you mess up, you can compromise the system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .