aboutsummaryrefslogblamecommitdiff
path: root/modules/nixos/ssh.nix
blob: b4c87723b162c6d36e0c1939f0a4a8dc79eb732f (plain) (tree)
1
2
3
4

             

                                               
















                                                        
{ 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";
      }
    ];
  };
}