I'm having an issue with syncing the unix permissions and ownership on the sysvol between two Ubuntu Samba AD DCs using unison. I have copied the idmap.ldb file from DC1 to DC2 and the Windows permissions seem to be set correctly on the sysvol. However, the incorrect Unix permissions and ownership is preventing clients from reading newly created policies from the sysvol on DC2. If I run
$ sudo samba-tool ntacl sysvolreset
the permissions issues are fixed and clients are able to read the policies.
My setup is based on the one here. However, our security policy does not allow root SSH connections, so I created a user, sysvolreplicator, with passwordless sudo permissions to use unison and rsync instead of using root. Here is my /root/.unison/default.prf
on DC1.
root = /var/lib/samba
root = ssh://sysvolreplicator@DC2//var/lib/samba
path = sysvol
auto=true
batch=true
perms=0
rsync=true
maxthreads=1
retry=3
confirmbigdeletes=false
servercmd=sudo /usr/bin/unison
copythreshold=0
copyprog = /usr/bin/rsync -XAavz --rsync-path='sudo /usr/bin/rsync' --rsh='ssh -p 22' --inplace
copyprogrest = /usr/bin/rsync -XAavz --rsync-path='sudo /usr/bin/rsync' --rsh='ssh -p 22' --partial --inplace
copyquoterem = true
copymax = 1
logfile = /var/log/sysvol-sync.log
Unison is run every 5 minutes by the root crontab. The unison version is 2.51.5 on both DCs. In addition, I tried the original unison config from the samba documentation in a test environment with root ssh and had the same issue.