Debian can't access partition with user, only root can

0

I have a permission problem - my users can't access to partition.

this partition is mounted with debian installer :

# /data was on /dev/sdd2 during installation
UUID=9271e7d3-aeac-419d-97cb-e5045adc789e /data           ext4    defaults        0       2

Permission is:

root@Shuwa:/data# ls -laFH
total 84
drwxrwxr-- 10 nas    data    4096 Aug 25 23:37 ./
drwxr-xr-x 23 root   root    4096 Aug 29 11:32 ../
drwsrws---  4 nas    data    4096 Aug 27 00:09 Download/
drwsrws--- 54 nas    data   36864 Aug 24 01:34 Film/
drwsrws--- 10 nas    data    4096 May 28 22:13 Image/
drwsrws---  2 nas    data   16384 May  1 23:25 lost+found/
drwsrws--- 10 alborq mirror  4096 Aug 28 19:55 mirror/
drwsrws--- 37 nas    data    4096 May 28 22:16 Musique/
drwsr-sr-x  3 nas    data    4096 Aug 25 23:51 PlexLib/
drwsrws--- 39 nas    data    4096 Jul  8 01:59 Serie/

I try to access from user named : alborq

alborq@Shuwa:~$ cd /data/
-bash: cd: /data/: Permission denied

But this dir has read for "Other". I don't understand..

=============================

For test I create test dir :

root@Shuwa:/data# mkdir test
root@Shuwa:/data# chown alborq. test
root@Shuwa:/data# chmod 777 test/
root@Shuwa:/data# ls -laFH |grep test
drwxrwxrwx  2 alborq alborq  4096 Aug 30 16:40 test/

but same problem :

alborq@Shuwa:~$ cd /data/test
-bash: cd: /data/test: Permission denied

but I have all permission and I'm owner

Alborq

Posted 2015-08-30T14:44:17.713

Reputation: 1

To cd a directory you need the execution permission on a directory. You say the other user has read permission, but does it also have the execution (+x) permission? – nKn – 2015-08-30T15:13:37.073

yes nKn mybad, but this not explain a problem with 777 and owner perm. – Alborq – 2015-08-30T15:23:07.733

Yes it does, because you're trying to cd a directory that is under /data. However, if /data didn't have the +x flag, you couldn't reach the subdirectory under it even if it is 777, so that's the expected behavior. – nKn – 2015-08-30T15:25:23.053

nKn thanks, damn i soo stupid i have forgot that, in my memory, if perm is set well in sub this not need good parent perm... – Alborq – 2015-08-30T15:36:23.240

Answers

1

To cd a directory you need the execution permission on a directory. You say the other user has read permission, but it also needs the execution (+x) flag.

Even if a subdirectory has 777 as permissions, as the parent directory doesn't have the execution flag, you won't be able to access it unless you grant the parent directory with the +x flag.

nKn

Posted 2015-08-30T14:44:17.713

Reputation: 4 960