ZFS How can user mount encryption dataset?

Hello. I granted : zfs allow sailorsamoor encryption,mount,create <dataset>
But sailorsamoor can enter load-key but dataset not mounting.
Code:
Enter passphrase for 'zroot/home/sailorsamoor/cache_enc':
Key load error: Permission denied.
admin%
What I have forget to allow?
 
What I have forget to allow?
Apparently mounting encrypted datasets by zfs-allow(8)'ed user, vfs.usermount=1 must be set in any case, and, unlike unencrypted datasets, the dataset mount point must be owned by the user.

Example:

To make "usermount" permanent: /etc/sysctl.conf
Code:
vfs.usermount=1
Reboot system or execute sysctl(8) command.

Code:
root# zfs create -o mountpoint=/enc -o encryption=on -o keyformat=passphrase -o keylocation=prompt zroot/enc

root# zfs allow john mount,load-key zroot/enc

root# chown john /enc

root# zfs umount -u zroot/enc

root# su john

john% zfs mount -l zroot/enc
See zfs-mount(8) for "-u" and "-l" options.
 
I did all except vfs.usermount=1.
There must be some sort of permissions set for users to mount file systems, otherwise, mounting (unmounting) a file system by a non-privileged user would be denied:
Rich (BB code):
john:~ $ zfs list -o name,mountpoint,mounted,keystatus zroot/enc
NAME       MOUNTPOINT  MOUNTED  KEYSTATUS
zroot/enc  /enc        no       unavailable

john:~ $ sysctl vfs.usermount
vfs.usermount: 0

john:~ $ zfs mount -l zroot/enc
Enter passphrase for 'zroot/enc':
cannot mount 'zroot/enc': Insufficient privileges

john:~ $ su -m root -c "sysctl vfs.usermount=1"
Password:
vfs.usermount: 0 -> 1

john:~ $ zfs list -o name,mountpoint,mounted,keystatus zroot/enc
NAME       MOUNTPOINT  MOUNTED  KEYSTATUS
zroot/enc  /enc        no       available

john:~ $ zfs mount zroot/enc

john:~ $ zfs list -o name,mountpoint,mounted zroot/enc
NAME       MOUNTPOINT  MOUNTED
zroot/enc  /enc        yes
 
Back
Top