Linux – Permission denied, but why

linuxpermissionsSecurity

I am trying to back up the contents of my network hard drive called WD mybook live. It Internally, it is running Debian Squeezy on PPC. There are several users on this network hard drive: tony, user2, user3, … Every user has his/her own directory /shares/ and a Linux user. It turns out that user tony only has access to his own /shares/tony directory, but not to the directories of the other users.

I have created another user pibackup and I want this user to be able to access all the users' directories. I made pibackup's primary group to be 'share', the same as the group of /shares/tony directory. However, pibackup still cannot access this directory.

Why permission denied? And how to make pibackup to have access to users' directories?

Here is some output from mybook:

$ whoami
pibackup 
$ id
uid=1100(pibackup) gid=1000(share) groups=1000(share)
$ pwd 
/shares
$ ls -ld tony/
drwxrwxr-x 15 nobody share 65536 Jan 12 18:50 tony/
$ getfacl tony 
 file: tony
 owner: nobody
 group: share
user::rwx 
group::rwx
other::r-x
$ ls tony/ 
ls: cannot open directory tony/: Permission denied

Just in case, here is the output of my mount command:

$ mount
/dev/md1 on / type ext3 (rw,noatime,nodiratime,barrier=1) 
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755,size=5M)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) 
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=5M)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw,size=100M) 
/var/log on /var/log.hdd type none (rw,bind)
ramlog-tmpfs on /var/log type tmpfs (rw,size=20M)
/dev/sda4 on /DataVolume type ext4 (rw,noatime,nodiratime)
/DataVolume/cache on /CacheVolume type none (rw,bind) 
/DataVolume/shares on /shares type none (rw,bind)
/DataVolume/shares on /nfs type none (rw,bind)
none on /sys/kernel/security type securityfs (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) 
nfsd on /proc/fs/nfsd type nfsd (rw)

Best Answer

There are a few options. As stated, "other::r-x". Depending on your configurations again, "pibackup" must be at least a member of the backup admins or suduers group. A bit crude, but possible, you do the backup of your book drive as root and do the backup

Related Question