summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2020-07-04 02:05:03 +0200
committerNiklas Hambüchen <mail@nh2.me>2020-07-04 02:05:03 +0200
commit06b8b96500502cb3bbd335242faf787e5d68bb9c (patch)
tree2d23ef814efcf271f2643bb0e2e26080fcc11013 /nixos/modules/config
parent2c33e5da9eb9feb82e2b77000e8488fdb8032fbc (diff)
downloadnixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar.gz
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar.bz2
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar.lz
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar.xz
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.tar.zst
nixpkgs-06b8b96500502cb3bbd335242faf787e5d68bb9c.zip
docs: Explain how to set password-less logins.
This explains the

    # Allow the user to log in as root without a password.
    users.users.root.initialHashedPassword = "";

that the NixOS installer live systems use in
`profiles/installation-device.nix`.
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/users-groups.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix
index 8defa86818a..e6b9a78f416 100644
--- a/nixos/modules/config/users-groups.nix
+++ b/nixos/modules/config/users-groups.nix
@@ -27,6 +27,15 @@ let
   hashedPasswordDescription = ''
     To generate hashed password install <literal>mkpasswd</literal>
     package and run <literal>mkpasswd -m sha-512</literal>.
+
+    For password-less logins without password prompt, use
+    the empty string <literal>""</literal>.
+
+    For logins with a fixed password (including the empty-string password with
+    prompt), use one of the un-hashed password options instead, such as
+    <option>users.users.<name?>.password</option>.
+
+    Such unprotected logins should only be used for e.g. bootable live systems.
   '';
 
   userOpts = { name, config, ... }: {