1.\" SPDX-License-Identifier: CDDL-1.0 2.\" 3.\" CDDL HEADER START 4.\" 5.\" The contents of this file are subject to the terms of the 6.\" Common Development and Distribution License (the "License"). 7.\" You may not use this file except in compliance with the License. 8.\" 9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10.\" or https://opensource.org/licenses/CDDL-1.0. 11.\" See the License for the specific language governing permissions 12.\" and limitations under the License. 13.\" 14.\" When distributing Covered Code, include this CDDL HEADER in each 15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16.\" If applicable, add the following below this CDDL HEADER, with the 17.\" fields enclosed by brackets "[]" replaced with your own identifying 18.\" information: Portions Copyright [yyyy] [name of copyright owner] 19.\" 20.\" CDDL HEADER END 21.\" 22.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. 23.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org> 24.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved. 25.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. 26.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. 27.\" Copyright (c) 2014 by Adam Stevko. All rights reserved. 28.\" Copyright (c) 2014 Integros [integros.com] 29.\" Copyright 2019 Richard Laager. All rights reserved. 30.\" Copyright 2018 Nexenta Systems, Inc. 31.\" Copyright 2019 Joyent, Inc. 32.\" 33.Dd March 16, 2022 34.Dt ZFS-ALLOW 8 35.Os 36. 37.Sh NAME 38.Nm zfs-allow 39.Nd delegate ZFS administration permissions to unprivileged users 40.Sh SYNOPSIS 41.Nm zfs 42.Cm allow 43.Op Fl dglu 44.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns … 45.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 46.Ar setname Oc Ns … 47.Ar filesystem Ns | Ns Ar volume 48.Nm zfs 49.Cm allow 50.Op Fl dl 51.Fl e Ns | Ns Sy everyone 52.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 53.Ar setname Oc Ns … 54.Ar filesystem Ns | Ns Ar volume 55.Nm zfs 56.Cm allow 57.Fl c 58.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 59.Ar setname Oc Ns … 60.Ar filesystem Ns | Ns Ar volume 61.Nm zfs 62.Cm allow 63.Fl s No @ Ns Ar setname 64.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 65.Ar setname Oc Ns … 66.Ar filesystem Ns | Ns Ar volume 67.Nm zfs 68.Cm unallow 69.Op Fl dglru 70.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns … 71.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 72.Ar setname Oc Ns … Oc 73.Ar filesystem Ns | Ns Ar volume 74.Nm zfs 75.Cm unallow 76.Op Fl dlr 77.Fl e Ns | Ns Sy everyone 78.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 79.Ar setname Oc Ns … Oc 80.Ar filesystem Ns | Ns Ar volume 81.Nm zfs 82.Cm unallow 83.Op Fl r 84.Fl c 85.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 86.Ar setname Oc Ns … Oc 87.Ar filesystem Ns | Ns Ar volume 88.Nm zfs 89.Cm unallow 90.Op Fl r 91.Fl s No @ Ns Ar setname 92.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 93.Ar setname Oc Ns … Oc 94.Ar filesystem Ns | Ns Ar volume 95. 96.Sh DESCRIPTION 97.Bl -tag -width "" 98.It Xo 99.Nm zfs 100.Cm allow 101.Ar filesystem Ns | Ns Ar volume 102.Xc 103Displays permissions that have been delegated on the specified filesystem or 104volume. 105See the other forms of 106.Nm zfs Cm allow 107for more information. 108.Pp 109Delegations are supported under Linux with the exception of 110.Sy mount , 111.Sy unmount , 112.Sy mountpoint , 113.Sy canmount , 114.Sy rename , 115and 116.Sy share . 117These permissions cannot be delegated because the Linux 118.Xr mount 8 119command restricts modifications of the global namespace to the root user. 120.It Xo 121.Nm zfs 122.Cm allow 123.Op Fl dglu 124.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns … 125.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 126.Ar setname Oc Ns … 127.Ar filesystem Ns | Ns Ar volume 128.Xc 129.It Xo 130.Nm zfs 131.Cm allow 132.Op Fl dl 133.Fl e Ns | Ns Sy everyone 134.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 135.Ar setname Oc Ns … 136.Ar filesystem Ns | Ns Ar volume 137.Xc 138Delegates ZFS administration permission for the file systems to non-privileged 139users. 140.Bl -tag -width "-d" 141.It Fl d 142Allow only for the descendent file systems. 143.It Fl e Ns | Ns Sy everyone 144Specifies that the permissions be delegated to everyone. 145.It Fl g Ar group Ns Oo , Ns Ar group Oc Ns … 146Explicitly specify that permissions are delegated to the group. 147.It Fl l 148Allow 149.Qq locally 150only for the specified file system. 151.It Fl u Ar user Ns Oo , Ns Ar user Oc Ns … 152Explicitly specify that permissions are delegated to the user. 153.It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns … 154Specifies to whom the permissions are delegated. 155Multiple entities can be specified as a comma-separated list. 156If neither of the 157.Fl gu 158options are specified, then the argument is interpreted preferentially as the 159keyword 160.Sy everyone , 161then as a user name, and lastly as a group name. 162To specify a user or group named 163.Qq everyone , 164use the 165.Fl g 166or 167.Fl u 168options. 169To specify a group with the same name as a user, use the 170.Fl g 171options. 172.It Xo 173.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 174.Ar setname Oc Ns … 175.Xc 176The permissions to delegate. 177Multiple permissions may be specified as a comma-separated list. 178Permission names are the same as ZFS subcommand and property names. 179See the property list below. 180Property set names, which begin with 181.Sy @ , 182may be specified. 183See the 184.Fl s 185form below for details. 186.El 187.Pp 188If neither of the 189.Fl dl 190options are specified, or both are, then the permissions are allowed for the 191file system or volume, and all of its descendants. 192.Pp 193Permissions are generally the ability to use a ZFS subcommand or change a ZFS 194property. 195The following permissions are available: 196.TS 197l l l . 198NAME TYPE NOTES 199_ _ _ 200allow subcommand Must also have the permission that is being allowed 201bookmark subcommand 202clone subcommand Must also have the \fBcreate\fR ability and \fBmount\fR ability in the origin file system 203create subcommand Must also have the \fBmount\fR ability. Must also have the \fBrefreservation\fR ability to create a non-sparse volume. 204destroy subcommand Must also have the \fBmount\fR ability 205diff subcommand Allows lookup of paths within a dataset given an object number, and the ability to create snapshots necessary to \fBzfs diff\fR. 206hold subcommand Allows adding a user hold to a snapshot 207load-key subcommand Allows loading and unloading of encryption key (see \fBzfs load-key\fR and \fBzfs unload-key\fR). 208change-key subcommand Allows changing an encryption key via \fBzfs change-key\fR. 209mount subcommand Allows mounting/unmounting ZFS datasets 210promote subcommand Must also have the \fBmount\fR and \fBpromote\fR ability in the origin file system 211receive subcommand Must also have the \fBmount\fR and \fBcreate\fR ability, required for \fBzfs receive -F\fR (see also \fBreceive:append\fR for limited, non forced receive) 212release subcommand Allows releasing a user hold which might destroy the snapshot 213rename subcommand Must also have the \fBmount\fR and \fBcreate\fR ability in the new parent 214rollback subcommand Must also have the \fBmount\fR ability 215send subcommand 216share subcommand Allows sharing file systems over NFS or SMB protocols 217snapshot subcommand Must also have the \fBmount\fR ability 218 219receive:append other Must also have the \fBmount\fR and \fBcreate\fR ability, limited receive ability (can not do receive -F) 220groupquota other Allows accessing any \fBgroupquota@\fI…\fR property 221groupobjquota other Allows accessing any \fBgroupobjquota@\fI…\fR property 222groupused other Allows reading any \fBgroupused@\fI…\fR property 223groupobjused other Allows reading any \fBgroupobjused@\fI…\fR property 224userprop other Allows changing any user property 225userquota other Allows accessing any \fBuserquota@\fI…\fR property 226userobjquota other Allows accessing any \fBuserobjquota@\fI…\fR property 227userused other Allows reading any \fBuserused@\fI…\fR property 228userobjused other Allows reading any \fBuserobjused@\fI…\fR property 229projectobjquota other Allows accessing any \fBprojectobjquota@\fI…\fR property 230projectquota other Allows accessing any \fBprojectquota@\fI…\fR property 231projectobjused other Allows reading any \fBprojectobjused@\fI…\fR property 232projectused other Allows reading any \fBprojectused@\fI…\fR property 233 234aclinherit property 235aclmode property 236acltype property 237atime property 238canmount property 239casesensitivity property 240checksum property 241compression property 242context property 243copies property 244dedup property 245defcontext property 246devices property 247dnodesize property 248encryption property 249exec property 250filesystem_limit property 251fscontext property 252keyformat property 253keylocation property 254logbias property 255mlslabel property 256mountpoint property 257nbmand property 258normalization property 259overlay property 260pbkdf2iters property 261primarycache property 262quota property 263readonly property 264recordsize property 265redundant_metadata property 266refquota property 267refreservation property 268relatime property 269reservation property 270rootcontext property 271secondarycache property 272setuid property 273sharenfs property 274sharesmb property 275snapdev property 276snapdir property 277snapshot_limit property 278special_small_blocks property 279sync property 280utf8only property 281version property 282volblocksize property 283volmode property 284volsize property 285vscan property 286xattr property 287zoned property 288.TE 289.It Xo 290.Nm zfs 291.Cm allow 292.Fl c 293.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 294.Ar setname Oc Ns … 295.Ar filesystem Ns | Ns Ar volume 296.Xc 297Sets 298.Qq create time 299permissions. 300These permissions are granted 301.Pq locally 302to the creator of any newly-created descendent file system. 303.It Xo 304.Nm zfs 305.Cm allow 306.Fl s No @ Ns Ar setname 307.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 308.Ar setname Oc Ns … 309.Ar filesystem Ns | Ns Ar volume 310.Xc 311Defines or adds permissions to a permission set. 312The set can be used by other 313.Nm zfs Cm allow 314commands for the specified file system and its descendants. 315Sets are evaluated dynamically, so changes to a set are immediately reflected. 316Permission sets follow the same naming restrictions as ZFS file systems, but the 317name must begin with 318.Sy @ , 319and can be no more than 64 characters long. 320.It Xo 321.Nm zfs 322.Cm unallow 323.Op Fl dglru 324.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns … 325.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 326.Ar setname Oc Ns … Oc 327.Ar filesystem Ns | Ns Ar volume 328.Xc 329.It Xo 330.Nm zfs 331.Cm unallow 332.Op Fl dlr 333.Fl e Ns | Ns Sy everyone 334.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 335.Ar setname Oc Ns … Oc 336.Ar filesystem Ns | Ns Ar volume 337.Xc 338.It Xo 339.Nm zfs 340.Cm unallow 341.Op Fl r 342.Fl c 343.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 344.Ar setname Oc Ns … Oc 345.Ar filesystem Ns | Ns Ar volume 346.Xc 347Removes permissions that were granted with the 348.Nm zfs Cm allow 349command. 350No permissions are explicitly denied, so other permissions granted are still in 351effect. 352For example, if the permission is granted by an ancestor. 353If no permissions are specified, then all permissions for the specified 354.Ar user , 355.Ar group , 356or 357.Sy everyone 358are removed. 359Specifying 360.Sy everyone 361.Po or using the 362.Fl e 363option 364.Pc 365only removes the permissions that were granted to everyone, not all permissions 366for every user and group. 367See the 368.Nm zfs Cm allow 369command for a description of the 370.Fl ldugec 371options. 372.Bl -tag -width "-r" 373.It Fl r 374Recursively remove the permissions from this file system and all descendants. 375.El 376.It Xo 377.Nm zfs 378.Cm unallow 379.Op Fl r 380.Fl s No @ Ns Ar setname 381.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns 382.Ar setname Oc Ns … Oc 383.Ar filesystem Ns | Ns Ar volume 384.Xc 385Removes permissions from a permission set. 386If no permissions are specified, then all permissions are removed, thus removing 387the set entirely. 388.El 389. 390.Sh EXAMPLES 391.\" These are, respectively, examples 17, 18, 19, 20 from zfs.8 392.\" Make sure to update them bidirectionally 393.Ss Example 1 : No Delegating ZFS Administration Permissions on a ZFS Dataset 394The following example shows how to set permissions so that user 395.Ar cindys 396can create, destroy, mount, and take snapshots on 397.Ar tank/cindys . 398The permissions on 399.Ar tank/cindys 400are also displayed. 401.Bd -literal -compact -offset Ds 402.No # Nm zfs Cm allow Sy cindys create , Ns Sy destroy , Ns Sy mount , Ns Sy snapshot Ar tank/cindys 403.No # Nm zfs Cm allow Ar tank/cindys 404---- Permissions on tank/cindys -------------------------------------- 405Local+Descendent permissions: 406 user cindys create,destroy,mount,snapshot 407.Ed 408.Pp 409Because the 410.Ar tank/cindys 411mount point permission is set to 755 by default, user 412.Ar cindys 413will be unable to mount file systems under 414.Ar tank/cindys . 415Add an ACE similar to the following syntax to provide mount point access: 416.Dl # Cm chmod No A+user : Ns Ar cindys Ns :add_subdirectory:allow Ar /tank/cindys 417. 418.Ss Example 2 : No Delegating Create Time Permissions on a ZFS Dataset 419The following example shows how to grant anyone in the group 420.Ar staff 421to create file systems in 422.Ar tank/users . 423This syntax also allows staff members to destroy their own file systems, but not 424destroy anyone else's file system. 425The permissions on 426.Ar tank/users 427are also displayed. 428.Bd -literal -compact -offset Ds 429.No # Nm zfs Cm allow Ar staff Sy create , Ns Sy mount Ar tank/users 430.No # Nm zfs Cm allow Fl c Sy destroy Ar tank/users 431.No # Nm zfs Cm allow Ar tank/users 432---- Permissions on tank/users --------------------------------------- 433Permission sets: 434 destroy 435Local+Descendent permissions: 436 group staff create,mount 437.Ed 438. 439.Ss Example 3 : No Defining and Granting a Permission Set on a ZFS Dataset 440The following example shows how to define and grant a permission set on the 441.Ar tank/users 442file system. 443The permissions on 444.Ar tank/users 445are also displayed. 446.Bd -literal -compact -offset Ds 447.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 448.No # Nm zfs Cm allow staff No @ Ns Ar pset tank/users 449.No # Nm zfs Cm allow Ar tank/users 450---- Permissions on tank/users --------------------------------------- 451Permission sets: 452 @pset create,destroy,mount,snapshot 453Local+Descendent permissions: 454 group staff @pset 455.Ed 456. 457.Ss Example 4 : No Delegating Property Permissions on a ZFS Dataset 458The following example shows to grant the ability to set quotas and reservations 459on the 460.Ar users/home 461file system. 462The permissions on 463.Ar users/home 464are also displayed. 465.Bd -literal -compact -offset Ds 466.No # Nm zfs Cm allow Ar cindys Sy quota , Ns Sy reservation Ar users/home 467.No # Nm zfs Cm allow Ar users/home 468---- Permissions on users/home --------------------------------------- 469Local+Descendent permissions: 470 user cindys quota,reservation 471cindys% zfs set quota=10G users/home/marks 472cindys% zfs get quota users/home/marks 473NAME PROPERTY VALUE SOURCE 474users/home/marks quota 10G local 475.Ed 476. 477.Ss Example 5 : No Removing ZFS Delegated Permissions on a ZFS Dataset 478The following example shows how to remove the snapshot permission from the 479.Ar staff 480group on the 481.Sy tank/users 482file system. 483The permissions on 484.Sy tank/users 485are also displayed. 486.Bd -literal -compact -offset Ds 487.No # Nm zfs Cm unallow Ar staff Sy snapshot Ar tank/users 488.No # Nm zfs Cm allow Ar tank/users 489---- Permissions on tank/users --------------------------------------- 490Permission sets: 491 @pset create,destroy,mount,snapshot 492Local+Descendent permissions: 493 group staff @pset 494.Ed 495