nix-config/modules/nix/networking/openssh.nix
smayzy 46c9281a62
All checks were successful
nix flake show / show-flake (push) Successful in 36s
prevent ssh root login
2025-08-09 16:57:53 +02:00

26 lines
516 B
Nix

{ lib, config, ... }:
let
inherit (lib) mkIf mkOption types;
in
{
options.smayzy.openssh.enable = mkOption {
type = types.bool;
default = false;
description = "openssh";
};
config = mkIf config.smayzy.openssh.enable {
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = true;
AllowUsers = null;
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "prohibit-password";
};
};
};
}