about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2024-05-29 03:08:47 +0000
committerNiklas Hambüchen <mail@nh2.me>2024-05-29 03:08:47 +0000
commit1f77a3c14be992021d02c4bfe9578ea93e8c0003 (patch)
tree8108f20e22978188682984b6d97a223ba75b4347 /nixos
parent1be779cf3c62c85798b3a89cb7a7609649671353 (diff)
turbovnc.tests: Fix passwordless test VM root login
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/turbovnc-headless-server.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/tests/turbovnc-headless-server.nix b/nixos/tests/turbovnc-headless-server.nix
index 0bbed231cebdc..44c4dcbc4fc8e 100644
--- a/nixos/tests/turbovnc-headless-server.nix
+++ b/nixos/tests/turbovnc-headless-server.nix
@@ -26,9 +26,13 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     # So that we can ssh into the VM, see e.g.
     # http://blog.patapon.info/nixos-local-vm/#accessing-the-vm-with-ssh
     services.openssh.enable = true;
-    services.openssh.settings.PermitRootLogin = "yes";
     users.extraUsers.root.password = "";
+    users.extraUsers.root.hashedPasswordFile = null; # avoids ambiguity warning during eval (`test-instrumentation.nix` sets it)
     users.mutableUsers = false;
+    # The following have to all be set to allow an empty SSH login password.
+    services.openssh.settings.PermitRootLogin = "yes";
+    services.openssh.settings.PermitEmptyPasswords = "yes";
+    security.pam.services.sshd.allowNullPassword = true; # the default `UsePam yes` makes this necessary
   };
 
   testScript = ''