# 22.5.委托管理

一个全面的权限委派系统允许非特权用户执行 ZFS 管理功能。例如，如果每个用户的主目录是一个数据集，用户需要获得创建和销毁其主目录快照的权限。执行备份的用户可以获得使用复制功能的权限。ZFS 还允许使用统计脚本，仅访问所有用户的空间使用数据。还可以委派权限委派的能力。权限委派适用于每个子命令和大多数属性。

## 22.5.1. 委派数据集创建权限

`zfs allow <某用户> create <数据集>` 允许指定的用户在所选父数据集下创建子数据集。一个注意事项是：创建新数据集涉及到挂载它，这要求将 FreeBSD 的 [sysctl(8)](https://man.freebsd.org/cgi/man.cgi?query=sysctl\&sektion=8\&format=html) `vfs.usermount` 设置为 `1`，以允许非 root 用户挂载文件系统。为了防止滥用，还有另一个限制：非 root 用户必须拥有挂载点的所有权，才能挂载文件系统。

## 22.5.2. 委派权限委派

`zfs allow <某用户> allow <数据集>` 赋予指定用户在目标数据集或其子数据集上将他们所拥有的任何权限委派给其他用户的能力。如果一个用户拥有 `snapshot` 权限和 `allow` 权限，该用户可以将 `snapshot` 权限授予其他用户。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.bsdcn.org/hanbook/di-22-zhang-z-wen-jian-xi-tong-zfs/22.5.-wei-tuo-guan-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
