Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Commit a5fdfe1

Browse files
authored
Merge pull request #20 from AkihiroSuda/fix-18
docs: update sudoers example to specify sha224 digests
2 parents f575691 + 5d0f315 commit a5fdfe1

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

etc_sudoers.d/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Example sudoers file for running `vde_vmnet`
2+
3+
To allow non-root users to run `vde_vmnet`, use [launchd](../launchd) *or*
4+
install [the `vde_vmnet` file in this directory](./vde_vmnet) as `/etc/sudoers.d/vde_vmnet`.
5+
6+
At least you have to modify the `sha224` digests in [`/etc/sudoers.d/vde_vmnet`](./vde_vmnet).
7+
See the comment lines in the file for the further information.

etc_sudoers.d/vde_vmnet

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
# To allow non-root users to run `vde_vmnet`, use launchd OR install this file as `/etc/sudoers.d/vde_vmnet`.
44

5+
# Prerequisite: Replace dummy sha224 digest values in this file with the actual sha224 digest values.
6+
# - `openssl dgst -binary -sha224 /usr/local/bin/vde_switch | openssl base64`
7+
# - `openssl dgst -binary -sha224 /usr/local/bin/vde_vmnet | openssl base64`
8+
59
# Usage:
610
# - sudo -u daemon -g staff /usr/local/bin/vde_switch ...
711
# - sudo /usr/local/bin/vde_vmnet ...
812

913
# Entries for shared mode (192.168.105.0/24)
10-
%staff ALL=(daemon:staff) NOPASSWD:NOSETENV: /usr/local/bin/vde_switch --sock=/var/run/vde.ctl --pidfile=/var/run/vde.pid --group=staff --dirmode=0770
11-
%staff ALL=(root:root) NOPASSWD:NOSETENV: /usr/local/bin/vde_vmnet --vmnet-gateway=192.168.105.1 /var/run/vde.ctl
14+
%staff ALL=(daemon:staff) NOPASSWD:NOSETENV: sha224:N9Msbbq+1xHLHUYgtkCQ/vDvY6sWpKUdZoJZ5g== /usr/local/bin/vde_switch --sock=/var/run/vde.ctl --pidfile=/var/run/vde.pid --group=staff --dirmode=0770
15+
%staff ALL=(root:root) NOPASSWD:NOSETENV: sha224:XQMHsLqtLONKq3yskqPXLFfKli/60d02UALUXg== /usr/local/bin/vde_vmnet --vmnet-gateway=192.168.105.1 /var/run/vde.ctl
1216

1317
# Entries for bridged mode (en0)
14-
%staff ALL=(daemon:staff) NOPASSWD:NOSETENV: /usr/local/bin/vde_switch --sock=/var/run/vde.bridged.en0.ctl --pidfile=/var/run/vde.bridged.en0.pid --group=staff --dirmode=0770
15-
%staff ALL=(root:root) NOPASSWD:NOSETENV: /usr/local/bin/vde_vmnet --vmnet-mode=bridged --vmnet-interface=en0 /var/run/vde.bridged.en0.ctl
18+
%staff ALL=(daemon:staff) NOPASSWD:NOSETENV: sha224:N9Msbbq+1xHLHUYgtkCQ/vDvY6sWpKUdZoJZ5g== /usr/local/bin/vde_switch --sock=/var/run/vde.bridged.en0.ctl --pidfile=/var/run/vde.bridged.en0.pid --group=staff --dirmode=0770
19+
%staff ALL=(root:root) NOPASSWD:NOSETENV: sha224:XQMHsLqtLONKq3yskqPXLFfKli/60d02UALUXg== /usr/local/bin/vde_vmnet --vmnet-mode=bridged --vmnet-interface=en0 /var/run/vde.bridged.en0.ctl

0 commit comments

Comments
 (0)