There are three machines in a network for this minimal example. A windows server acts as a domain (with everything that involves), a Synology NAS that's used to store some data and backups, and a Linux host that needs to access that same NAS.
Since I don't want to mess up or maintain a separate set of permissions on the NAS, the Linux host should just use the same access mechanism that the windows hosts do; for that, I mount the share as CIFS and ask a Kerberos ticket from the windows server. This functions; and the share mounts.
But then I encounter something that can only really be described as a WTF?.
Suppose the domain has two users, wuB and wuV. The user wuV has created a folder on the Synology share. I now want to access this file as the (windows domain) user wuB, from the Linux host.
I run the following on a Linux machine:
$ kinit [email protected] $ mount --verbose -t cifs -o sec=krb5i,vers=2.0,username=root,uid=0000,gid=0000,iocharset=utf8,dir_mode=0777,file_mode=0777,noperm //mysynology.company.com/backup /var/backups/synology1 mount.cifs kernel mount options (...) $ cd /var/backups/synology1/ $ ls existing_dir_owned_by_wuV $ mkdir testdir $ cd testdir $ touch testfile $ echo "yessir" > testfile $ cat testfile yessir $ ls -lha drwxrwxrwx 2 root root 0 Sep 20 12:28 . drwxrwxrwx 2 root root 0 Sep 20 12:28 .. -rwxrwxrwx 1 root root 6 Sep 20 12:28 testfile $ cd .. $ cd existing_dir_owned_by_wuV $ ls -la '.' : permission denied $ cat existing_file_in_subfolder permission denied $ cd .. $ cat existing_file_in_mainfolder hello world Checking the ownership on the synology: it's marked as owned by company.com/wuB for the testfolder, the existing folder is marked as owned by company.com/wuV. This means that yes, I am accessing the share as the windows user wuB here.
On the synology the Windows/NTFS style permissions are set only on the share itself; subfolders/files inherit permissions only. Both wuV and wuB are marked as having Read&Write access on all the files in the share. When mounting, the linux permissions are set to 777. I'm doing all the operations as root on the linux machine so the permissions issues aren't originating from there either.
How is this even possible?
How do I solve the problem?