On https://www.freebsd.org/doc/handbook/zfs-zfs.html under heading 19.4.7.2. Sending Encrypted Backups over SSH the text says the following. "To mount the pool, the unprivileged user must own the directory, and regular users must be allowed to mount file systems. On the receiving system: # sysctl vfs.usermount=1 vfs.usermount: 0 -> 1 # sysrc -f /etc/sysctl.conf vfs.usermount=1 # zfs create recvpool/backup # zfs allow -u someuser create,mount,receive recvpool/backup # chown someuser /recvpool/backup" When I type the following as using sudo on my 12.1-RELEASE-p2 system I get an error. [mike@nas ~]$ sudo sysrc -f /etc/sysctl.conf vfs.usermount=1 sysrc: vfs.usermount: name contains characters not allowed in shell When I change to the root user I get the same error. [mike@nas ~]$ sudo -i root@nas:~ # sysrc -f /etc/sysctl.conf vfs.usermount=1 sysrc: vfs.usermount: name contains characters not allowed in shell It seems like the valid characters variable in /usr/share/bsdconfig/sysrc.subr is incorrect. VALID_VARNAME_CHARS="0-9ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_" Should it include a period? Also, I believe the documentation should clarify when a user needs to run as root versus when to run as a non-root user. At least it seems like every command should be run as root but it is not clear. I had to manually edit the /etc/sysctl.conf file.
I just realized that my comment about the root versus non-root user is already stated with the change in the prompt symbol.
Yeah, sysrc cannot be used for sysctls, it only works for shell variables like rc.conf This bit of documentation should be reverted to the original code: echo vfs.usermount=1 >> /etc/sysctl.conf I have commented on the offending change here: https://reviews.freebsd.org/D12127
A commit references this bug: Author: allanjude Date: Sat Jul 11 15:48:48 UTC 2020 New revision: 54327 URL: https://svnweb.freebsd.org/changeset/doc/54327 Log: Don't use sysrc for sysctl OIDs PR: 246760 Submitted by: debdrup Reported by: Mike Plemmons <mikeplemmons@gmail.com> Sponsored by: Klara Inc. Event: July 2020 Bugathon Differential Revision: https://reviews.freebsd.org/D12127 Changes: head/en_US.ISO8859-1/books/handbook/zfs/chapter.xml