about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-09-10 06:13:07 +0200
committerGitHub <noreply@github.com>2020-09-10 06:13:07 +0200
commit940195c0e7bebb0d0a08f979af8b82c5c4ba96aa (patch)
tree0d017ad1ebaea1a9d11ca7cb53de5c9026fac400 /nixos/modules
parent5985b5c94c4cc72ec636cae9e883465913c1710d (diff)
parent0e7f6a884b939823471cde875cf258a2aa2b3535 (diff)
downloadnixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar.gz
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar.bz2
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar.lz
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar.xz
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.tar.zst
nixlib-940195c0e7bebb0d0a08f979af8b82c5c4ba96aa.zip
Merge pull request #96991 from Mic92/sshd
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/profiles/installation-device.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix
index d05c0c50e82c..e68ea1b08776 100644
--- a/nixos/modules/profiles/installation-device.nix
+++ b/nixos/modules/profiles/installation-device.nix
@@ -51,22 +51,23 @@ with lib;
     services.mingetty.helpLine = ''
       The "nixos" and "root" accounts have empty passwords.
 
-      Type `sudo systemctl start sshd` to start the SSH daemon.
-      You then must set a password for either "root" or "nixos"
-      with `passwd` to be able to login.
+      An ssh daemon is running. You then must set a password
+      for either "root" or "nixos" with `passwd` or add an ssh key
+      to /home/nixos/.ssh/authorized_keys be able to login.
     '' + optionalString config.services.xserver.enable ''
       Type `sudo systemctl start display-manager' to
       start the graphical user interface.
     '';
 
-    # Allow sshd to be started manually through "systemctl start sshd".
+    # We run sshd by default. Login via root is only possible after adding a
+    # password via "passwd" or by adding a ssh key to /home/nixos/.ssh/authorized_keys.
+    # The latter one is particular useful if keys are manually added to
+    # installation device for head-less systems i.e. arm boards by manually
+    # mounting the storage in a different system.
     services.openssh = {
       enable = true;
-      # Allow password login to the installation, if the user sets a password via "passwd"
-      # It is safe as root doesn't have a password by default and SSH is disabled by default
       permitRootLogin = "yes";
     };
-    systemd.services.sshd.wantedBy = mkOverride 50 [];
 
     # Enable wpa_supplicant, but don't start it by default.
     networking.wireless.enable = mkDefault true;