-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
useradd changes to /etc/sub[ug]id don't persist past next activation #64606
Copy link
Copy link
Open
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Description
Issue description
On a NixOS system with mutableUsers = true, the admin is supposed to be able to imperatively add users by running useradd.
The useradd command automatically allocates a UID and GID range for the new user if /etc/subuid or /etc/subgid exist, which they always do on NixOS.
However, all changes to these two files are overwritten on the next system reboot or nixos-rebuild, which to me seems counter to the intent of mutableUsers.
Steps to reproduce
useradd -m testuser
grep '^testuser:' /etc/sub[ug]id # should match
/run/current-system/activate
grep '^testuser:' /etc/sub[ug]id # nothingTechnical details
- system:
"x86_64-linux" - host os:
Linux 5.1.14, NixOS, 19.09.git.6cc7e33 (Loris) - sandbox:
yes - version:
nix-env (Nix) 2.2.2
The channel info isn't meaningful because I built from a git checkout, not my normal channels, and I tested in a container that didn't have access to /nix/var anyway.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS