Adding ssh

This commit is contained in:
Miguel Palhas
2024-10-06 11:52:19 +01:00
parent 66c1527a6b
commit 8001c55931
4 changed files with 22 additions and 2 deletions
+8
View File
@@ -45,5 +45,13 @@ in
];
shell = pkgs.zsh;
initialHashedPassword = "$y$j9T$uRTzF/sBdrqVGZTRhPuR00$wgLgEGlq.lEmlCPiy69jkbtfC9HKpyaVPDHDdBGtE5D";
openssh.authorizedKeys.keys =
let
authorizedKeys = pkgs.fetchurl {
url = "https://github.com/naps62.keys";
sha256 = "sha256-dP8LjaburPwfIr2jhly9rMwOLJyUkQP7Em5IKH/qXbY=";
};
in
pkgs.lib.splitString "\n" (builtins.readFile authorizedKeys);
};
}
+9 -2
View File
@@ -1,4 +1,11 @@
{ inputs, pkgs, ... }:
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.openssh ];
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
};
};
}