summary refs log tree commit diff
path: root/nixos/modules/config/users-groups.nix
Commit message (Collapse)AuthorAge
* Fix references to current-system/sw/sbinWilliam A. Kennington III2015-04-01
|
* Add "input" groupEelco Dolstra2015-03-03
| | | | This is required by systemd >= 215.
* fix manualDomen Kožar2015-01-03
|
* clarify things about hashed passwords and mutableUsersDomen Kožar2015-01-02
|
* Obsolete security.initialPasswordEelco Dolstra2014-11-03
| | | | You can now set users.extraUsers.root.initialHashedPassword instead.
* Handle initialPassword and initialHashedPassword for !mutableUsersEelco Dolstra2014-11-03
| | | | | | In this case, they're equivalent to setting ‘password’ and ‘hashedPassword’ (since there is no distinction between an initial and non-initial user account state).
* Add initialPassword and initialHashedPassword optionsEelco Dolstra2014-11-03
| | | | | These are like password and hashedPassword, except that they only apply when the user is initially created.
* passwordFile: update descriptionLongrin Wischnewski2014-10-23
|
* nixos: Add also group.members to groupRickard Nilsson2014-09-22
|
* Support users-groups.json referring to store pathsEelco Dolstra2014-09-10
| | | | Fixes #4016.
* Fix subuid/subgid generationEelco Dolstra2014-09-05
| | | | | I don't think we need to filter users with an unset uid, because mkSubuidEntry/mkSubgidEntry don't references the uid.
* Merge recent master into stagingVladimír Čunát2014-08-30
|\ | | | | | | | | | | | | | | | | Hydra: ?compare=1149952 Conflicts: nixos/doc/manual/configuration.xml (changed split file) nixos/modules/config/users-groups.nix (choosing filterNull instead of inline definition) pkgs/development/libraries/readline/readline6.3.nix (auto-solved)
| * nixos/users-groups: Fix eval on missing uid/gid.aszlig2014-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This hopefully fixes a regression introduced by 08b214a. In bf129a2, it was already fixed for normal uid/gid values and it got reintroduced by sub-uid/gid-handling again, so I've refactored it a bit into a filterNull function which takes care of also the filtering introduced by bf129a2. I have not tested this extensively, but master is already broken for systems with `mutableUsers = true` and no uid values set. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
| * Merge pull request #3100 from tailhook/new-shadowMichael Raskin2014-08-29
| |\ | | | | | | Upgrade "shadow" to 4.2.1
| | * First implementation of subuid/subgid manipulation modulePaul Colomiets2014-08-01
| | |
* | | Merge recent master into stagingVladimír Čunát2014-08-21
|\| | | | | | | | | | | | | | | | | | | | Hydra: ?compare=1148749 Conflicts (easy): nixos/modules/virtualisation/containers.nix
| * | use mkDefault on root's shellMatej Cotman2014-08-20
| |/
* | Add user attribute isNormalUserEelco Dolstra2014-08-15
| | | | | | | | | | This is shorthand for setting group, createHome, home, useDefaultShell and isSystemUser.
* | Unify mutableUsers = { true, false }Eelco Dolstra2014-08-15
|/ | | | | | | | | | | | | | | | | | | | With mutableUsers = true, we now ensure that all users and groups that were created declaratively, are updated or removed appropriately. Thus, adding a user to users.extraUsers and then removing it now causes the acoount to be removed from /etc/passwd. Thus user/group management is fully congruent except that users and groups that were created imperatively (via useradd/groupadd) are not touched. We distinguish between declarative and imperative users/groups by tracking the former in /var/lib/nixos/declarative-{groups,users}. With mutableUsers = false, you are now no longer required to specify UIDs/GIDs for all users. The handling of mutableUsers = true/false is the same code path; the only difference is that the "false" mode ignores the existing contents of /etc/{passwd,group}. The attribute ‘createUser’ is gone. It doesn't really make sense to specify users that shouldn't be created.
* better error message in case of missing uidsSönke Hahn2014-05-28
|
* fix -G delimiter in call to useraddCharles Strahan2014-05-17
|
* nixos-install: Ask the user to set a root passwordEelco Dolstra2014-05-09
| | | | This removes the need to have an initially empty root password.
* Fix users.*.extraGroups for users.mutableUsers = true.Rob Vermaas2014-05-05
| | | | (cherry picked from commit eb222923054fdc895ab73ff5d0260c1e1fc689c7)
* Bring back the isSystemUser optionEelco Dolstra2014-04-29
|
* Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra2014-04-14
| | | | | | | | Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
* nixos: add grsecurity module (#1875)Austin Seipp2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This module implements a significant refactoring in grsecurity configuration for NixOS, making it far more usable by default and much easier to configure. - New security.grsecurity NixOS attributes. - All grsec kernels supported - Allows default 'auto' grsec configuration, or custom config - Supports custom kernel options through kernelExtraConfig - Defaults to high-security - user must choose kernel, server/desktop mode, and any virtualisation software. That's all. - kptr_restrict is fixed under grsecurity (it's unwriteable) - grsecurity patch creation is now significantly abstracted - only need revision, version, and SHA1 - kernel version requirements are asserted for sanity - built kernels can have the uname specify the exact grsec version for development or bug reports. Off by default (requires `security.grsecurity.config.verboseVersion = true;`) - grsecurity sysctl support - By default, disabled. - For people who enable it, NixOS deploys a 'grsec-lock' systemd service which runs at startup. You are expected to configure sysctl through NixOS like you regularly would, which will occur before the service is started. As a result, changing sysctl settings requires a reboot. - New default group: 'grsecurity' - Root is a member by default - GRKERNSEC_PROC_GID is implicitly set to the 'grsecurity' GID, making it possible to easily add users to this group for /proc access - AppArmor is now automatically enabled where it wasn't before, despite implying features.apparmor = true The most trivial example of enabling grsecurity in your kernel is by specifying: security.grsecurity.enable = true; security.grsecurity.testing = true; # testing 3.13 kernel security.grsecurity.config.system = "desktop"; # or "server" This specifies absolutely no virtualisation support. In general, you probably at least want KVM host support, which is a little more work. So: security.grsecurity.enable = true; security.grsecurity.stable = true; # enable stable 3.2 kernel security.grsecurity.config = { system = "server"; priority = "security"; virtualisationConfig = "host"; virtualisationSoftware = "kvm"; hardwareVirtualisation = true; } This module has primarily been tested on Hetzner EX40 & VQ7 servers using NixOps. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Don't add users if createUser is falseRickard Nilsson2014-04-08
|
* Allow undefined uids and gids when mutableUsers = trueRickard Nilsson2014-04-06
| | | | | | | | Groups and users without gid/uid are created with useradd/groupadd after the passwd/group merge phase if mutableUsers = true. This should fix #2114.
* Allow directly setting hashedPassword for rootShea Levy2014-02-16
|
* user-groups: Sidestep all password escaping issuesShea Levy2014-02-10
| | | | Now passwords are written to a file first
* Properly escape passwords sent to chpasswdThomas Tuegel2014-02-10
| | | | | | | | | The mutableUsers feature uses `chpasswd` to set users passwords. Passwords and their hashes were being piped into the program using double quotes ("") to escape. This causes any `$` characters to be expanded as shell variables. This is a serious problem because all the password hash methods besides DES use multiple `$` in the hashes. Single quotes ('') should be used instead to prevent shell variable expansion.
* Add option to enforce uniqueness of uids/gids (on by default)Shea Levy2014-02-07
| | | | Signed-off-by: Shea Levy <shea@shealevy.com>
* Add description to group.members optionRickard Nilsson2014-02-05
|
* Re-introduce security.initialRootPassword, and add a new option ↵Rickard Nilsson2014-02-05
| | | | users.extraUsers.<user>.hashedPassword
* Generate /etc/passwd and /etc/group at build timeRickard Nilsson2014-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rather large commit that switches user/group creation from using useradd/groupadd on activation to just generating the contents of /etc/passwd and /etc/group, and then on activation merging the generated files with the files that exist in the system. This makes the user activation process much cleaner, in my opinion. The users.extraUsers.<user>.uid and users.extraGroups.<group>.gid must all be properly defined (if <user>.createUser is true, which it is by default). My pull request adds a lot of uids/gids to config.ids to solve this problem for existing nixos services, but there might be configurations that break because this change. However, this will be discovered during the build. Option changes introduced by this commit: * Remove the options <user>.isSystemUser and <user>.isAlias since they don't make sense when generating /etc/passwd statically. * Add <group>.members as a complement to <user>.extraGroups. * Add <user>.passwordFile for setting a user's password from an encrypted (shadow-style) file. * Add users.mutableUsers which is true by default. This means you can keep managing your users as previously, by using useradd/groupadd manually. This is accomplished by merging the generated passwd/group file with the existing files in /etc on system activation. The merging of the files is simplistic. It just looks at the user/group names. If a user/group exists both on the system and in the generated files, the system entry will be kept un-changed and the generated entries will be ignored. The merging itself is performed with the help of vipw/vigr to properly lock the account files during edit. If mutableUsers is set to false, the generated passwd and group files will not be merged with the system files on activation. Instead they will simply replace the system files, and overwrite any changes done on the running system. The same logic holds for user password, if the <user>.password or <user>.passwordFile options are used. If mutableUsers is false, password will simply be replaced on activation. If true, the initial user passwords will be set according to the configuration, but existing passwords will not be touched. I have tested this on a couple of different systems and it seems to work fine so far. If you think this is a good idea, please test it. This way of adding local users has been discussed in issue #103 (and this commit solves that issue).
* Print a reminder to users to set or disable the root passwordEelco Dolstra2013-11-01
|
* Don't set an initial null root password for Amazon / VirtualBox imagesEelco Dolstra2013-11-01
| | | | | | | | | A null password allows logging into local PAM services such as "login" (agetty) and KDM. That's not actually a security problem for EC2 machines, since they do not have "local" logins; for VirtualBox machines, if you local access, you can do anything anyway. But it's better to be on the safe side and disable password-based logins for root.
* Improve description of the users.extraUsers.*.description optionEelco Dolstra2013-10-31
| | | | Fixes NixOS/nixos#278.
* Add lots of missing option typesEelco Dolstra2013-10-30
|
* Substitute "types.uniq types.string" -> "types.str"Eelco Dolstra2013-10-30
|
* Move all of NixOS to nixos/ in preparation of the repository mergeEelco Dolstra2013-10-10