about summary refs log tree commit diff
path: root/nixos/modules/programs/shadow.nix
AgeCommit message (Collapse)AuthorFilesLines
2023-11-30treewide: replace `mkPackageOptionMD` with `mkPackageOption`h7x41-1/+1
2023-05-20nixos/shadow: refactor login.defs config optionsGeorges1-100/+208
Add a settings option for the login.defs file to provide enhanced configuration abilities. Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2023-05-09nixos/shadow: Set default encrypt methodMartin Weinelt1-0/+2
Fixes the default for tools like chpasswd, chgpasswd and gpasswd. Closes: #230880
2022-07-30treewide: automatically md-convert option descriptionspennae1-1/+1
the conversion procedure is simple: - find all things that look like options, ie calls to either `mkOption` or `lib.mkOption` that take an attrset. remember the attrset as the option - for all options, find a `description` attribute who's value is not a call to `mdDoc` or `lib.mdDoc` - textually convert the entire value of the attribute to MD with a few simple regexes (the set from mdize-module.sh) - if the change produced a change in the manual output, discard - if the change kept the manual unchanged, add some text to the description to make sure we've actually found an option. if the manual changes this time, keep the converted description this procedure converts 80% of nixos options to markdown. around 2000 options remain to be inspected, but most of those fail the "does not change the manual output check": currently the MD conversion process does not faithfully convert docbook tags like <code> and <package>, so any option using such tags will not be converted at all.
2021-10-04nixos/doc: clean up defaults and examplesNaïm Favier1-1/+1
2021-09-13nixos: explicitely set security.wrappers ownershiprnhmjoj1-7/+14
This is slightly more verbose and inconvenient, but it forces you to think about what the wrapper ownership and permissions will be.
2020-06-02Merge pull request #51270 from aneeshusa/enable-setuid-wrapper-for-chshJörg Thalheim1-2/+3
nixos/shadow: create setuid wrapper for chsh
2020-01-06treewide: use attrs instead of list for types.loaOf optionsrnhmjoj1-16/+12
2019-10-14nixos/users: Increase maximum system uid/gid from 499 to 999Silvan Mosberger1-2/+12
This enlarges the system uid/gid range 6-fold, from 100 to 600 ids. This is a preventative measure against running out of dynamically allocated ids for NixOS services with isSystemUser, which should become the preferred way of allocating uids for non-real users.
2019-04-07nixos/shadow: create setuid wrapper for chshAneesh Agrawal1-2/+3
This allows non-declarative users to change their login shells. https://github.com/NixOS/nixpkgs/pull/41966 will make this possible for declarative users as well if the system config explicitly allows it.
2018-01-14sg/newgrp should always be available, not chfnJesper Geertsen Jonsson1-5/+5
sg and newgrp only changes the current user session and should be available to users even if the "users.mutableUsers" option is set. These are common, useful commands. chfn does modify the /etc/passwd GECOS field which is also controlled by the option "users.users.<name?>.description", so it's less appropriate to make it available when "users.mutableUsers" is set. However, because CHFN_RESTRICT in login.defs is never set in current NixOS the chfn functionality is never available to users anyway and may as well have its SUID disabled, as only root is able to use it. This is recommended in the chfn man page in this case.
2017-01-29Set merge + mkIf always surprises meParnell Springmeyer1-2/+2
2017-01-29More fixesParnell Springmeyer1-4/+10
2017-01-28Addressing PR feedbackParnell Springmeyer1-44/+4
2017-01-25setcap-wrapper: Merging with upstream master and resolving conflictsParnell Springmeyer1-1/+0
2016-09-06Enable the runuser command from util-linuxEelco Dolstra1-1/+0
Fixes #14701.
2016-09-01Need to create a new build to see why it's failingParnell Springmeyer1-0/+1
2016-09-01Resolving that silly bad argument error.Parnell Springmeyer1-1/+1
2016-09-01Adapting everything for the merged permissions wrappers work.Parnell Springmeyer1-3/+3
2016-09-01everything?: Updating every package that depended on the old setuidPrograms ↵Parnell Springmeyer1-6/+43
configuration.
2016-08-19nixos/shadow: setuid wrappers for new{uid,gid}mapBenno Fünfstück1-3/+2
These utils are not related to user management, so they should be available even if immutable users are enabled.
2016-06-12Use shell packages to select the user's shellzimbatm1-8/+10
The string type is still available for backward-compatiblity.
2015-04-14nixos: condition shadow setuid-wrappers on mutableUsersJoachim Fasting1-2/+4
Having junk setuid wrappers in PATH is annoying.
2015-03-30sg: add setuid wrapper. (newgrp is a symlink to sg and was already setuid).obadz1-1/+1
sudo: add ability for wheel users to change group (as well as user)
2014-09-02Merge pull request #2644 from lethalman/pam_tallyMichael Raskin1-1/+1
pam: Add logFailures option for adding pam_tally to su
2014-08-01Upgrade shadow packagePaul Colomiets1-1/+3
2014-07-02Get all lib functions from lib, not pkgs.lib, in modulesShea Levy1-2/+2
2014-06-19nixos/shadow: Add an example for defaultUserShell.aszlig1-0/+1
Thanks to @devhell for the suggestion. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-05-14pam: Add logFailures option for adding pam_tally to suLuca Bruno1-1/+1
2014-04-29Allocate system uids/gids between 400 and 500Eelco Dolstra1-2/+2
Previously it was between 100 and 500, but this can already collide with the static uids/guid in misc/ids.nix.
2014-04-14Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra1-2/+2
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.
2014-04-11Revert "nixos: fix shell on conatiners"Peter Simons1-1/+1
This reverts commit c69577b7d6ea96cd605043440145ea6e094674b5. See https://github.com/NixOS/nixpkgs/pull/2198 for further details.
2014-04-10nixos: fix shell on conatinersJaka Hudoklin1-1/+1
2014-02-05Only add shadow to system packages if users.mutableUsers is trueRickard Nilsson1-1/+2
2014-02-05Generate /etc/passwd and /etc/group at build timeRickard Nilsson1-0/+2
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).
2013-10-30Add lots of missing option typesEelco Dolstra1-1/+1
2013-10-15Turn security.pam.services into an attribute setEelco Dolstra1-13/+13
That is, you can say security.pam.services.sshd = { options... }; instead of security.pam.services = [ { name = "sshd"; options... } ]; making it easier to override PAM settings from other modules.
2013-10-10Move all of NixOS to nixos/ in preparation of the repository mergeEelco Dolstra1-0/+103