Files
nix-config/modules/nixos/base/ssh.nix
2025-05-21 12:16:00 +08:00

22 lines
746 B
Nix

{lib, ...}: {
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = lib.mkDefault false;
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
settings = {
X11Forwarding = true;
# root user is used for remote deployment, so we need to allow it
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false; # disable password login
};
openFirewall = true;
};
# Add terminfo database of all known terminals to the system profile.
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/config/terminfo.nix
environment.enableAllTerminfo = true;
}