2025-01-04 03:04:27 +03:00
. \" SPDX-License-Identifier: CDDL-1.0
2019-11-12 22:17:40 +03:00
. \"
. \" CDDL HEADER START
. \"
. \" The contents of this file are subject to the terms of the
. \" Common Development and Distribution License (the "License").
. \" You may not use this file except in compliance with the License.
. \"
. \" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2022-07-12 00:16:13 +03:00
. \" or https://opensource.org/licenses/CDDL-1.0.
2019-11-12 22:17:40 +03:00
. \" See the License for the specific language governing permissions
. \" and limitations under the License.
. \"
. \" When distributing Covered Code, include this CDDL HEADER in each
. \" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
. \" If applicable, add the following below this CDDL HEADER, with the
. \" fields enclosed by brackets "[]" replaced with your own identifying
. \" information: Portions Copyright [yyyy] [name of copyright owner]
. \"
. \" CDDL HEADER END
. \"
. \" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
. \" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
. \" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
. \" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
. \" Copyright (c) 2014, Joyent, Inc. All rights reserved.
. \" Copyright (c) 2014 by Adam Stevko. All rights reserved.
. \" Copyright (c) 2014 Integros [integros.com]
. \" Copyright 2019 Richard Laager. All rights reserved.
. \" Copyright 2018 Nexenta Systems, Inc.
. \" Copyright 2019 Joyent, Inc.
. \"
2022-03-16 20:20:22 +03:00
.Dd March 16 , 2022
2019-11-12 22:17:40 +03:00
.Dt ZFS-ALLOW 8
2020-08-21 21:55:47 +03:00
.Os
2021-05-27 03:46:40 +03:00
.
2019-11-12 22:17:40 +03:00
.Sh NAME
2020-10-22 21:28:10 +03:00
.Nm zfs-allow
2021-05-27 03:46:40 +03:00
.Nd delegate ZFS administration permissions to unprivileged users
2019-11-12 22:17:40 +03:00
.Sh SYNOPSIS
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Op Fl dglu
2021-05-27 03:46:40 +03:00
.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Op Fl dl
.Fl e Ns | Ns Sy everyone
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Fl c
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Fl s No @ Ns Ar setname
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl dglru
2021-05-27 03:46:40 +03:00
.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl dlr
.Fl e Ns | Ns Sy everyone
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl r
.Fl c
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl r
.Fl s No @ Ns Ar setname
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
2021-05-27 03:46:40 +03:00
.
2019-11-12 22:17:40 +03:00
.Sh DESCRIPTION
.Bl -tag -width ""
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Ar filesystem Ns | Ns Ar volume
.Xc
Displays permissions that have been delegated on the specified filesystem or
volume.
See the other forms of
.Nm zfs Cm allow
for more information.
.Pp
Delegations are supported under Linux with the exception of
.Sy mount ,
.Sy unmount ,
.Sy mountpoint ,
.Sy canmount ,
.Sy rename ,
and
.Sy share .
These permissions cannot be delegated because the Linux
.Xr mount 8
command restricts modifications of the global namespace to the root user.
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Op Fl dglu
2021-05-27 03:46:40 +03:00
.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Op Fl dl
.Fl e Ns | Ns Sy everyone
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
Delegates ZFS administration permission for the file systems to non-privileged
users.
.Bl -tag -width "-d"
.It Fl d
Allow only for the descendent file systems.
.It Fl e Ns | Ns Sy everyone
Specifies that the permissions be delegated to everyone.
2021-05-27 03:46:40 +03:00
.It Fl g Ar group Ns Oo , Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
Explicitly specify that permissions are delegated to the group.
.It Fl l
Allow
.Qq locally
only for the specified file system.
2021-05-27 03:46:40 +03:00
.It Fl u Ar user Ns Oo , Ns Ar user Oc Ns …
2019-11-12 22:17:40 +03:00
Explicitly specify that permissions are delegated to the user.
2021-05-27 03:46:40 +03:00
.It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
Specifies to whom the permissions are delegated.
Multiple entities can be specified as a comma-separated list.
If neither of the
.Fl gu
options are specified, then the argument is interpreted preferentially as the
keyword
.Sy everyone ,
then as a user name, and lastly as a group name.
To specify a user or group named
.Qq everyone ,
use the
.Fl g
or
.Fl u
options.
To specify a group with the same name as a user, use the
.Fl g
options.
.It Xo
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Xc
The permissions to delegate.
Multiple permissions may be specified as a comma-separated list.
Permission names are the same as ZFS subcommand and property names.
See the property list below.
Property set names, which begin with
.Sy @ ,
may be specified.
See the
.Fl s
form below for details.
.El
.Pp
If neither of the
.Fl dl
options are specified, or both are, then the permissions are allowed for the
file system or volume, and all of its descendents.
.Pp
Permissions are generally the ability to use a ZFS subcommand or change a ZFS
property.
The following permissions are available:
2021-05-27 03:46:40 +03:00
.TS
l l l .
NAME TYPE NOTES
_ _ _
allow subcommand Must also have the permission that is being allowed
bookmark subcommand
clone subcommand Must also have the \fB create\fR ability and \fB mount\fR ability in the origin file system
create subcommand Must also have the \fB mount\fR ability. Must also have the \fB refreservation\fR ability to create a non-sparse volume.
destroy subcommand Must also have the \fB mount\fR ability
diff subcommand Allows lookup of paths within a dataset given an object number, and the ability to create snapshots necessary to \fB zfs diff\fR .
hold subcommand Allows adding a user hold to a snapshot
2021-07-20 23:21:18 +03:00
load-key subcommand Allows loading and unloading of encryption key (see \fB zfs load-key\fR and \fB zfs unload-key\fR ).
change-key subcommand Allows changing an encryption key via \fB zfs change-key\fR .
2021-05-27 03:46:40 +03:00
mount subcommand Allows mounting/umounting ZFS datasets
promote subcommand Must also have the \fB mount\fR and \fB promote\fR ability in the origin file system
2025-03-13 20:54:14 +03:00
receive subcommand Must also have the \fB mount\fR and \fB create\fR ability, required for \fB zfs receive -F\fR (see also \fB receive:append\fR for limited, non forced receive)
2021-05-27 03:46:40 +03:00
release subcommand Allows releasing a user hold which might destroy the snapshot
rename subcommand Must also have the \fB mount\fR and \fB create\fR ability in the new parent
rollback subcommand Must also have the \fB mount\fR ability
send subcommand
share subcommand Allows sharing file systems over NFS or SMB protocols
snapshot subcommand Must also have the \fB mount\fR ability
2019-11-12 22:17:40 +03:00
2025-03-13 20:54:14 +03:00
receive:append other Must also have the \fB mount\fR and \fB create\fR ability, limited receive ability (can not do receive -F)
2022-03-24 22:14:25 +03:00
groupquota other Allows accessing any \fB groupquota@\fI …\fR property
groupobjquota other Allows accessing any \fB groupobjquota@\fI …\fR property
groupused other Allows reading any \fB groupused@\fI …\fR property
groupobjused other Allows reading any \fB groupobjused@\fI …\fR property
2021-05-27 03:46:40 +03:00
userprop other Allows changing any user property
2022-03-24 22:14:25 +03:00
userquota other Allows accessing any \fB userquota@\fI …\fR property
userobjquota other Allows accessing any \fB userobjquota@\fI …\fR property
userused other Allows reading any \fB userused@\fI …\fR property
userobjused other Allows reading any \fB userobjused@\fI …\fR property
projectobjquota other Allows accessing any \fB projectobjquota@\fI …\fR property
projectquota other Allows accessing any \fB projectquota@\fI …\fR property
projectobjused other Allows reading any \fB projectobjused@\fI …\fR property
projectused other Allows reading any \fB projectused@\fI …\fR property
2019-11-12 22:17:40 +03:00
2021-05-27 03:46:40 +03:00
aclinherit property
2021-07-20 23:21:18 +03:00
aclmode property
2021-05-27 03:46:40 +03:00
acltype property
atime property
canmount property
casesensitivity property
checksum property
compression property
2021-07-20 23:21:18 +03:00
context property
2021-05-27 03:46:40 +03:00
copies property
2021-07-20 23:21:18 +03:00
dedup property
defcontext property
2021-05-27 03:46:40 +03:00
devices property
2021-07-20 23:21:18 +03:00
dnodesize property
encryption property
2021-05-27 03:46:40 +03:00
exec property
filesystem_limit property
2021-07-20 23:21:18 +03:00
fscontext property
keyformat property
keylocation property
logbias property
mlslabel property
2021-05-27 03:46:40 +03:00
mountpoint property
nbmand property
normalization property
2021-07-20 23:21:18 +03:00
overlay property
pbkdf2iters property
2021-05-27 03:46:40 +03:00
primarycache property
quota property
readonly property
recordsize property
2021-07-20 23:21:18 +03:00
redundant_metadata property
2021-05-27 03:46:40 +03:00
refquota property
refreservation property
2021-07-20 23:21:18 +03:00
relatime property
2021-05-27 03:46:40 +03:00
reservation property
2021-07-20 23:21:18 +03:00
rootcontext property
2021-05-27 03:46:40 +03:00
secondarycache property
setuid property
sharenfs property
sharesmb property
2021-07-20 23:21:18 +03:00
snapdev property
2021-05-27 03:46:40 +03:00
snapdir property
snapshot_limit property
2021-07-20 23:21:18 +03:00
special_small_blocks property
sync property
2021-05-27 03:46:40 +03:00
utf8only property
version property
volblocksize property
2021-07-20 23:21:18 +03:00
volmode property
2021-05-27 03:46:40 +03:00
volsize property
vscan property
xattr property
zoned property
.TE
2019-11-12 22:17:40 +03:00
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Fl c
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
Sets
.Qq create time
permissions.
These permissions are granted
.Pq locally
to the creator of any newly-created descendent file system.
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm allow
.Fl s No @ Ns Ar setname
.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns …
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
Defines or adds permissions to a permission set.
The set can be used by other
.Nm zfs Cm allow
commands for the specified file system and its descendents.
Sets are evaluated dynamically, so changes to a set are immediately reflected.
Permission sets follow the same naming restrictions as ZFS file systems, but the
name must begin with
.Sy @ ,
and can be no more than 64 characters long.
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl dglru
2021-05-27 03:46:40 +03:00
.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns …
2019-11-12 22:17:40 +03:00
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl dlr
.Fl e Ns | Ns Sy everyone
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl r
.Fl c
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
Removes permissions that were granted with the
.Nm zfs Cm allow
command.
No permissions are explicitly denied, so other permissions granted are still in
effect.
For example, if the permission is granted by an ancestor.
If no permissions are specified, then all permissions for the specified
.Ar user ,
.Ar group ,
or
.Sy everyone
are removed.
Specifying
.Sy everyone
.Po or using the
.Fl e
option
.Pc
only removes the permissions that were granted to everyone, not all permissions
for every user and group.
See the
.Nm zfs Cm allow
command for a description of the
.Fl ldugec
options.
.Bl -tag -width "-r"
.It Fl r
Recursively remove the permissions from this file system and all descendents.
.El
.It Xo
2020-10-22 21:28:10 +03:00
.Nm zfs
2019-11-12 22:17:40 +03:00
.Cm unallow
.Op Fl r
.Fl s No @ Ns Ar setname
.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
2021-05-27 03:46:40 +03:00
.Ar setname Oc Ns … Oc
2019-11-12 22:17:40 +03:00
.Ar filesystem Ns | Ns Ar volume
.Xc
Removes permissions from a permission set.
If no permissions are specified, then all permissions are removed, thus removing
the set entirely.
.El
2022-03-16 20:20:22 +03:00
.
.Sh EXAMPLES
. \" These are, respectively, examples 17, 18, 19, 20 from zfs.8
. \" Make sure to update them bidirectionally
.Ss Example 1 : No Delegating ZFS Administration Permissions on a ZFS Dataset
The following example shows how to set permissions so that user
.Ar cindys
can create, destroy, mount, and take snapshots on
.Ar tank/cindys .
The permissions on
.Ar tank/cindys
are also displayed.
.Bd -literal -compact -offset Ds
.No # Nm zfs Cm allow Sy cindys create , Ns Sy destroy , Ns Sy mount , Ns Sy snapshot Ar tank/cindys
.No # Nm zfs Cm allow Ar tank/cindys
---- Permissions on tank/cindys --------------------------------------
Local+Descendent permissions:
user cindys create,destroy,mount,snapshot
.Ed
.Pp
Because the
.Ar tank/cindys
mount point permission is set to 755 by default, user
.Ar cindys
will be unable to mount file systems under
.Ar tank/cindys .
Add an ACE similar to the following syntax to provide mount point access:
2022-11-12 15:23:30 +03:00
.Dl # Cm chmod No A+user : Ns Ar cindys Ns :add_subdirectory:allow Ar /tank/cindys
2022-03-16 20:20:22 +03:00
.
.Ss Example 2 : No Delegating Create Time Permissions on a ZFS Dataset
The following example shows how to grant anyone in the group
.Ar staff
to create file systems in
.Ar tank/users .
This syntax also allows staff members to destroy their own file systems, but not
destroy anyone else's file system.
The permissions on
.Ar tank/users
are also displayed.
.Bd -literal -compact -offset Ds
.No # Nm zfs Cm allow Ar staff Sy create , Ns Sy mount Ar tank/users
.No # Nm zfs Cm allow Fl c Sy destroy Ar tank/users
.No # Nm zfs Cm allow Ar tank/users
---- Permissions on tank/users ---------------------------------------
Permission sets:
destroy
Local+Descendent permissions:
group staff create,mount
.Ed
.
.Ss Example 3 : No Defining and Granting a Permission Set on a ZFS Dataset
The following example shows how to define and grant a permission set on the
.Ar tank/users
file system.
The permissions on
.Ar tank/users
are also displayed.
.Bd -literal -compact -offset Ds
.No # Nm zfs Cm allow Fl s No @ Ns Ar pset Sy create , Ns Sy destroy , Ns Sy snapshot , Ns Sy mount Ar tank/users
.No # Nm zfs Cm allow staff No @ Ns Ar pset tank/users
.No # Nm zfs Cm allow Ar tank/users
---- Permissions on tank/users ---------------------------------------
Permission sets:
@pset create,destroy,mount,snapshot
Local+Descendent permissions:
group staff @pset
.Ed
.
.Ss Example 4 : No Delegating Property Permissions on a ZFS Dataset
The following example shows to grant the ability to set quotas and reservations
on the
.Ar users/home
file system.
The permissions on
.Ar users/home
are also displayed.
.Bd -literal -compact -offset Ds
.No # Nm zfs Cm allow Ar cindys Sy quota , Ns Sy reservation Ar users/home
.No # Nm zfs Cm allow Ar users/home
---- Permissions on users/home ---------------------------------------
Local+Descendent permissions:
user cindys quota,reservation
cindys% zfs set quota=10G users/home/marks
cindys% zfs get quota users/home/marks
NAME PROPERTY VALUE SOURCE
users/home/marks quota 10G local
.Ed
.
.Ss Example 5 : No Removing ZFS Delegated Permissions on a ZFS Dataset
The following example shows how to remove the snapshot permission from the
.Ar staff
group on the
.Sy tank/users
file system.
The permissions on
.Sy tank/users
are also displayed.
.Bd -literal -compact -offset Ds
.No # Nm zfs Cm unallow Ar staff Sy snapshot Ar tank/users
.No # Nm zfs Cm allow Ar tank/users
---- Permissions on tank/users ---------------------------------------
Permission sets:
@pset create,destroy,mount,snapshot
Local+Descendent permissions:
group staff @pset
.Ed