From 2fea36c19eb904125e2db5ba230b28d72dc881db Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 12 Sep 2025 13:11:20 -0700 Subject: start to refactor nixos modules --- modules/nixos/ssh.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 modules/nixos/ssh.nix (limited to 'modules/nixos/ssh.nix') diff --git a/modules/nixos/ssh.nix b/modules/nixos/ssh.nix new file mode 100644 index 0000000..b4c8772 --- /dev/null +++ b/modules/nixos/ssh.nix @@ -0,0 +1,21 @@ +{ lib, ... }: +{ + networking.firewall.allowedTCPPorts = [ 22 ]; + + services.openssh = { + enable = lib.mkDefault true; + settings = { + PasswordAuthentication = lib.mkForce false; + KbdInteractiveAuthentication = lib.mkForce false; + + PermitRootLogin = lib.mkForce "prohibit-password"; + }; + openFirewall = lib.mkDefault true; + hostKeys = [ + { + path = "/etc/ssh/ssh_host_ed25519_key"; + type = "ed25519"; + } + ]; + }; +} -- cgit v1.2.3