fix(users): align daniel uid/gid with kanidm (uid=1000, gid=1000) #496
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "align-daniel-uid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Collapses the two-identity collision found in #495's wake (local daniel at uid 1000 gid 997, kanidm daniel at uid 2001 gid 2001) by aligning both on uid 1000 / gid 1000.
lib/modules/nixos/default-module.nix: pinusers.users.daniel.uid = 1000andusers.groups.daniel.gid = 1000(previously auto-allocated to 1000 and 997 respectively).secrets/beefcake/kanidm-migrations.yml: addposixaccountclass +gidnumber: 1000to daniel's person entry so the posix attributes are reproducible from git instead of living only in kanidm's DB.align-daniel-gid: on first boot post-deploy, chgrp any files under/home/danielstill at the old gid over to 1000. Idempotent via/var/lib/lyte/align-daniel-gid.done. Ordered beforesystemd-user-sessions.service. Safe to leave in tree; can be removed once every host has migrated.Why this (rather than the fuller migrate-to-kanidm-only approach)
Having kanidm and nix agree on the numeric identity eliminates the collision symptoms (shadowed users, split group memberships, unreachable home dirs) with dramatically less churn than ripping out
users.users.daniel. The break-glass properties of the local user are preserved. Seeissues/open/migrate-daniel-to-kanidm-only.mdfor the long-term plan if/when fuller separation becomes useful.Caveats
posixaccountclass +gidnumbersyntax in the migration HJSON format isn't explicitly documented in kanidm's example files — it's inferred from the attribute schema. First deploy to beefcake will confirm the migration applies cleanly. Revert is trivial if it rejects.kanidm person posix set-gidnumber(the value 2001 lived only in the SQLite DB). This PR is the first time the value is tracked in git.Test plan
id danielreturns uid=1000 gid=1000, files in/home/danielchgrp'd successfully, marker file present.getent passwd daniel/getent passwd daniel@idm.h.lyte.devboth resolve to uid=1000.getent group danielreturns a single unambiguous gid=1000 entry (duplicates from the pre-migration two-gid state go away).6e63b72f376bc26dd084Superseded — approach shifted to letting kanidm fully own uid/gid (UUID-derived) rather than pinning both sides to 1000. Replacement PR coming with the kanidm-takeover migration.
Pull request closed