The install script assumes the admin group already has sudo #1

Open
opened 2026-09-24 14:25:07 +00:00 by alex · 0 comments
Owner

install-oath-sudo.sh writes two sudoers drop-ins:

  • 50-oath-enroll — %<group> ALL=(root) NOPASSWD: /usr/local/sbin/oath-enroll "", the bootstrap path
  • 51-oath-timestamp — Defaults timestamp_timeout=15

Neither grants the admin group general sudo. On a host where that grant already exists (an existing admin box) nothing is wrong. On a fresh node it produces a confusing result: the OTP is accepted and authorisation then fails.

One-time password (OATH) for `alex': alex is not in the sudoers file.

That is the correct order — authenticate, then authorise — and it reads like the OTP failed when it did not.

Measured 2026-09-24 while implementing this on a fresh NixOS node (homelab#97), where nothing had granted echo_admin sudo beforehand.

Worth deciding rather than leaving implicit: either the installer writes the general grant too (with a flag, since on an existing host it would be redundant), or the README states that the admin group must already have sudo and that this script only adds the OTP factor and the bootstrap path.

The second is probably right — the script's job is the sudo factor, not the sudo policy — but it should say so.

`install-oath-sudo.sh` writes two sudoers drop-ins: - `50-oath-enroll` — `%<group> ALL=(root) NOPASSWD: /usr/local/sbin/oath-enroll ""`, the bootstrap path - `51-oath-timestamp` — `Defaults timestamp_timeout=15` Neither grants the admin group **general** sudo. On a host where that grant already exists (an existing admin box) nothing is wrong. On a **fresh** node it produces a confusing result: the OTP is accepted and authorisation then fails. ``` One-time password (OATH) for `alex': alex is not in the sudoers file. ``` That is the correct order — authenticate, then authorise — and it reads like the OTP failed when it did not. Measured 2026-09-24 while implementing this on a fresh NixOS node (homelab#97), where nothing had granted `echo_admin` sudo beforehand. **Worth deciding rather than leaving implicit:** either the installer writes the general grant too (with a flag, since on an existing host it would be redundant), or the README states that the admin group must already have sudo and that this script only adds the OTP factor and the bootstrap path. The second is probably right — the script's job is the sudo *factor*, not the sudo *policy* — but it should say so.
Sign in to join this conversation.
No labels
ci
docs
nix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex/oath-sudo#1
No description provided.