From 20093751ec96b43d87f0850fc3ad541237405564 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Nov 2013 14:50:24 +0100 Subject: [PATCH] Print a reminder to users to set or disable the root password --- nixos/modules/config/users-groups.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 79570fc2571..714de646eb7 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -258,6 +258,22 @@ in fi ''; + # Print a reminder for users to set a root password. + environment.interactiveShellInit = + '' + if [ "$UID" = 0 ]; then + read _l < /etc/shadow + if [ "''${_l:0:6}" = root:: ]; then + cat >&2 <