LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Have permission but can't access folder (https://www.linuxquestions.org/questions/linux-newbie-8/have-permission-but-cant-access-folder-4175647832/)

marcselman 02-07-2019 01:30 PM

Have permission but can't access folder
 
I have a user marc in the group marc. There's a media directory with a subdirectory marc that the user can access. There are also two mounted usb disks there.
I have a second user sonarr who is also in the group marc. But this user can't access the directory /media/marc even though all permissions seem to be correct.

Here is the console output:

Code:

sonarr@media-pc:/media$ cd marc
-su: cd: marc: Permission denied
sonarr@media-pc:/media$ id
uid=123(sonarr) gid=1001(sonarr) groups=1001(sonarr),1000(marc)
sonarr@media-pc:/media$ ls -al
total 12
drwxr-xr-x  3 root root 4096 feb  7 19:46 .
drwxr-xr-x  24 root root 4096 jan 31 18:53 ..
drwxrwxrwx+  4 marc marc 4096 feb  7 19:46 marc
sonarr@media-pc:/media$

How is this possible?

ehartman 02-07-2019 01:44 PM

Quote:

Originally Posted by marcselman (Post 5959108)
I have a second user sonarr who is also in the group marc. But this user can't access the directory /media/marc even though all permissions seem to be correct.

How is this possible?

If the filesystems ON the shared media are vfat (or ntfs), it is quite common that only the UserID can read or write ON that medium.
Look at the mounted fs to see what IT's permissions are, they often are -rwx------

See also the mount options for FAT filesystems, especially the fmask and dmask ones.

The problem is that a vfat filesystem does NOT have the concept of fileowner or group, so the mount program imposes a mask ON it, which often is "only for the mounting UID".

marcselman 02-07-2019 01:57 PM

Thanks for the quick reply
 
Quote:

Originally Posted by ehartman (Post 5959116)
If the filesystems ON the shared media are vfat (or ntfs), it is quite common that only the UserID can read or write ON that medium.
Look at the mounted fs to see what IT's permissions are, they often are -rwx------

See also the mount options for FAT filesystems, especially the fmask and dmask ones.

The problem is that a vfat filesystem does NOT have the concept of fileowner or group, so the mount program imposes a mask ON it, which often is "only for the mounting UID".


The marc directory itself is not a mounted usb drive. There are two drives mounted as subdirectories in there. One is a ext4 filesystem and the other ntfs.
I'm not sure how to check the things you mentioned.
But the first step would be getting access to the marc folder before seeing if I can access the drives from there.

Corvette 02-07-2019 06:51 PM

I noticed there is a + at the end of the permissions for the "marc" directory. Thus, ACL permissions could be the issue. Try 'getfacl marc'. See here for more information https://serverfault.com/questions/22...ions-from-ls-l

marcselman 02-08-2019 02:27 AM

Quote:

Originally Posted by Corvette (Post 5959195)
I noticed there is a + at the end of the permissions for the "marc" directory. Thus, ACL permissions could be the issue. Try 'getfacl marc'. See here for more information https://serverfault.com/questions/22...ions-from-ls-l

I see thanks.
When I run the command I get:

Code:

marc@media-pc:/media$ getfacl marc
# file: marc
# owner: marc
# group: marc
user::rwx
user:marc:r-x
group::---
group:plex:r-x
mask::rwx
other::rwx

I don't really know how to interpret this.
Any user has rwx, any group has --- and any other has rwx? That makes no sense right...

Corvette 02-08-2019 07:15 AM

Honestly, I do not use ACLs myself for permissions, but, try the following:
Code:

setfacl -Rm g:marc:rwx marc
This is saying to modify (-m) the ACL permissions recursively (-R), by granting those in group (g) marc read, write and execute (rwx) permissions on the marc folder. Alternatively, you could try and remove the ACLs using the following:
Code:

setfacl -b marc


All times are GMT -5. The time now is 06:25 AM.