Cannot receive 'zfs send' as non-root user, with 'zfs allow' set

Status
Not open for further replies.

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
I'm not sure what it is that is wrong, but I have been unable to send snapshots from a FreeBSD 11 machine using zxfer, as a normal user, doing everything I can think of.

So far the things I have done to enable ZFS send receive as a regular user are the following:

Set vfs.usermount=1

Set every zfs allow setting I can think of:

Code:
 ~# zfs allow tank/replication/Wrath
zfs allow tank/replication/Wrath
---- Permissions on tank/replication/Wrath ---------------------------
Local+Descendent permissions:
	user replicator atime,canmount,casesensitivity,checksum,compression,copies,create,dedup,destroy,diff,exec,filesystem_count,filesystem_limit,hold,jailed,logbias,mount,mountpoint,normalization,quota,readonly,receive,recordsize,redundant_metadata,refquota,refreservation,release,reservation,send,setuid,share,sharenfs,sharesmb,snapdir,snapshot_count,snapshot_limit,sync,userprop,utf8only,volmode
---- Permissions on tank/replication ---------------------------------
Local+Descendent permissions:
	user replicator compression,create,destroy,diff,mount,mountpoint,readonly,receive,release,send,userprop


But whenever I ran zxfer, sshing as a non root user, and to a destination I own, I got:

Code:
~ # zxfer -dFkPv -T replicator@<backup server> -R vault tank/replication/Wrath
Creating destination filesystem "tank/replication/Wrath/vault" with specified properties.
cannot create 'tank/replication/Wrath/vault': permission denied
Error when creating destination filesystem.


I even tried ssh'ing in to root on my freenas in order to create the data sets, and that seemed to work correctly sending the snapshots, however, when I then tried to send as a non-administrator after the root user had sent, I got 'cannot mount' warnings;

Code:
cannot mount 'tank/replication/Wrath/vault/usr/home': Insufficient privileges
cannot mount 'tank/replication/Wrath/vault/usr/ports': Insufficient privileges
cannot mount 'tank/replication/Wrath/vault/usr/src': Insufficient privileges


I don't want to leave my machine with the ability to ssh in to my freenas as root, but it won't work otherwise!

I've tried everything I can think of. What is going wrong? Is there a bug here?
 
Last edited:

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Nope.

Another problem i'm having is, and I think this is related to how `zfs recv' wants datasets to be unmounted on receive: If the dataset I am sending to is mounted, which i'm sure you know is by default, I am welcomed with hundreds of the following:

Code:
collectd[42972]: statvfs(/mnt/tank/replication/Wrath/vault) failed: No such file or directory 


I've seen previous mentions of it on the forums. Right now I have ended up just leaving the datasets I am replicating to unmounted. I'm not sure if this is working by design, or if I should post a bug report.

Ideally I guess I would set up the requirements to integrate with the GUI when replicating, is it at all possible to do that?
 

fd0

Dabbler
Joined
Sep 11, 2013
Messages
19
Any news on this?

zxfer does a remote "zfs create" that fails...
 
Status
Not open for further replies.
Top