Files
nix-config/modules/nixos/base/ssh.nix
2024-11-22 13:58:51 +08:00

29 lines
804 B
Nix

{
lib,
myvars,
...
}: {
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = lib.mkDefault false;
programs.ssh = myvars.networking.ssh;
# 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-24.11/nixos/modules/config/terminfo.nix
environment.enableAllTerminfo = true;
}