Repository navigation
user: add/remove users, groups, sudo level + managing-users manual - #14366
nightdevil00 wants to merge 7 commits into
Conversation
New 'omarchy user' command group for second logins on shared machines (first boot still owns the single-owner flow via provision-owner): - user add: create login user, groups (default wheel), password via passwd, optional password sudo via validated sudoers drop-in - user groups: pick/add/remove/set supplementary groups, primary kept - user privileges: password sudo or none (per-user drop-in, validated) - user remove: refuse root/system/self, terminate session, drop home and managed sudoers file on request All four: gum interactive + --yes scripted, visudo -c validated, registered in GROUP_DESCRIPTIONS. Manual 49 documents the group and contrasts permanent grants with the expiring Passwordless Sudo toggle. Standalone companion: greeter multi-user picker (separate PR, each merges independently).
|
|
Thanks for putting this together. A few things need fixing before this is safe to merge, mostly around how the sudo level is shown versus what the account can actually do:
Tests with stubbed |
…ection, and address review feedback
|
Thanks for switching to
Running |
- Share self/last-admin wheel checks via omarchy-user-functions so groups and privileges enforce the same rules - Only refuse group changes that actually remove wheel; match group names exactly - Fix ((count++)) exiting under set -e, and 'if interactive:' syntax error - Add --skip-password flag and allow creating users with no groups - privileges --level none is a no-op with a warning when not in wheel - Add user-admin shell test with stubbed id/getent/sudo
Address the remaining review item on omacom#14366 (safety checks lack tests). The user-remove script already refuses system accounts (UID<1000) and resolves the target's UID before the self-check, but neither path was covered. Add fixtures/tests for: - removing a system account (UID>=1000 required to proceed) - removing yourself by numeric UID (getent resolves it; UID self-check must still block it before any privileged command runs) Also let the getent stub resolve a numeric UID argument, matching real getent, so the numeric case is exercised end to end. All 17 checks pass.
- omarchy-user-remove: drop the 'mail spool not found' notice from userdel output; other userdel errors still fail with their message - user add/groups: gum checklist hint says 'x to toggle' (space does not toggle)
Preserve account safety in wheel-based administration
|
On my laptop this merges clean on quattro and |
Omarchy provisions one owner on first boot, but there is no supported path for a second login on the same machine (family member, handoff, separate work account).
This adds an 'omarchy user' command group:
All four run interactively via gum or scripted with explicit flags plus --yes, validate with visudo -c, and are registered in GROUP_DESCRIPTIONS. manual/49-managing-users.md documents the group and contrasts the permanent grant with the expiring Passwordless Sudo toggle.
Verified: bash -n clean, --help smoke-tested, router lists all four under 'omarchy user', ./test/cli passes (117 ok).
Related: a companion PR (#14365) reworks the SDDM greeter with a user/session picker, keyboard nav, and focus highlight. The two stand alone - each merges and works independently; together they cover shared-machine logins end to end.