3

I am trying to ensure that certain files in a mounted filesystem are readable to at least one non-root user. However, at the moment, even root user is not able to read these files. Here is my situation:

Here is the relevant line in fstab:

sshfs#andrew.eisenberg@marykate:/ /mnt/marykate fuse defaults,uid=1000,gid=1000,idmap=user,allow_other,follow_symlinks 0 0

(Note that andrew.eisenberg user is already a member of the groups fuse, redis, and david)

On the marykate machine, here is the directory in question:

[13:48] marykate:~
$ ll /var/lib/redis/7000
total 1089640
-rw-rw---- 1 redis 671476509 Jun 15 13:48 appendonly.aof
-rw-rw---- 1 redis 444305035 Jun 15 13:47 dump.rdb

On the target machine, it looks like this:

[13:46] ashley:/mnt/marykate/var/lib/redis/7000
$ ll
total 1091116
-rw-rw---- 1 david 672465989 Jun 15 13:49 appendonly.aof
-rw-rw---- 1 david 444831971 Jun 15 13:49 dump.rdb

And there are no users who can actually access these files:

$ sudo less appendonly.aof
appendonly.aof: Permission denied
$ sudo -u david less appendonly.aof
appendonly.aof: Permission denied

I think the reason why the files are owned by a different user is because the uids of the two machines don't match up.

However, I am completely confused why I am not able to read these files.

I am quite new to this and am just stumbling around, so any other advice on what I should do would be appreciated.


EDIT I have a workaround, but I am not happy with it. In the mounted filesystems, I have changed all the relevant files to be readable by all. And now on the base file system, I am able to read them all.

I do not like this solution since I do not want to make these files world readable. I would prefer to keep them user/group readable only, but don't know how.

0

You must log in to answer this question.

Browse other questions tagged .