Score:1

Samba AD sysvol sync unison permissions issue

mr flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.