Skip to content

Instantly share code, notes, and snippets.

@joshenders
Last active November 12, 2017 18:58
Show Gist options
  • Save joshenders/03a1e31aeb9f813e2ef8 to your computer and use it in GitHub Desktop.
Save joshenders/03a1e31aeb9f813e2ef8 to your computer and use it in GitHub Desktop.
/etc/sudoers.d/zfs
# Allow read-only ZoL commands to be called through sudo without a password.
# Cmnd alias specification
Cmnd_Alias RO_ZFS = \
/sbin/zfs "", /sbin/zfs help *, \
/sbin/zfs get, /sbin/zfs get *, \
/sbin/zfs list, /sbin/zfs list *, \
/sbin/zpool "", /sbin/zpool help *, \
/sbin/zpool iostat, /sbin/zpool iostat *, \
/sbin/zpool list, /sbin/zpool list *, \
/sbin/zpool status, /sbin/zpool status *, \
/sbin/zpool upgrade, /sbin/zpool upgrade -v
# Allow any user in the zfsusers group to use basic read-only ZFS commands.
%zfsusers ALL=NOPASSWD: RO_ZFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment