ZFS zfs send / receive to different system and data ownership

At the moment I rsync files from a server to a backup server using rsync. This allows me to have all files owned by the backup server "user account" which is what I want. Doing zfs send / receive to backup server keeps the same UIDs and the result is the files owned by "other" user account on the backup server. Is any way to force zfs send / receive to upload files with a specific owner?
 
At the moment I rsync files from a server to a backup server using rsync. This allows me to have all files owned by the backup server "user account" which is what I want. Doing zfs send / receive to backup server keeps the same UIDs and the result is the files owned by "other" user account on the backup server. Is any way to force zfs send / receive to upload files with a specific owner?

No; UID/GIDs will be the same on the source and destination. You can, however, use zfs-allow(8) to give the backup user the ability receive,mount,create on the destination zfs datasets such that the backup can be performed by the backup user (without root/su/sudo permissions.). Somthing like zfs allow backup_user create,mount,receive pool/backup/dataset ... if you're backing up a system pool (with a / mount, for example), be sure to consider some additional options on the receive like -x mountpoint to avoid surprises.
 
Back
Top