Andreas Wiese say that if you have common group id across all hosts you may solve your issue with setgid bit and ACL
I ask question Predefined group ids across Linux distros?Predefined group ids across Linux distros?
After own research found that such group exist across all touched distros: sys group share id 3 on Debian, Ubuntu, RedHat, Fedora, CentOS, Suse, FreeBSD, OpenBSD, NetBSD, MacOSX, Solaris.
With this:
$ sudo chgrp -R sys /mnt/data/dir $ sudo chmod -R g+s /mnt/data/dir $ sudo setfacl -R -m g:sys:rwx /mnt/data/dir $ sudo setfacl -R -d -m g:sys:rwx /mnt/data/dir and flavor of this:
$ sudo adduser user sys you user be able to read/write any file on /dir.
Most job may do setgid bit but unfortunately you usually have little control on umask. So ACL is used to provide complete solution.
See also:
- https://askubuntu.com/questions/12009/solving-permission-problems-when-using-external-ext4-hard-disk-with-multiple-lin/
- https://askubuntu.com/questions/252361/how-could-i-mount-an-ext4-partition-and-have-write-permission/
- https://serverfault.com/questions/306344/sharing-an-ext3-ext4-partition-on-external-drive/