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