System/modules/linux/services/ssh.nix

29 lines
613 B
Nix
Raw Normal View History

2022-06-23 02:57:41 -04:00
{ config, lib, pkgs, ... }:
let nathan = config.nathan;
in with lib; {
2022-06-23 02:57:41 -04:00
config = mkIf nathan.services.ssh {
networking.firewall = {
allowedTCPPorts = [ 22 ];
allowedUDPPorts = [ 22 ];
};
services.openssh = {
enable = true;
extraConfig = ''
StreamLocalBindUnlink yes
'';
listenAddresses = [{
addr = "0.0.0.0";
port = 22;
}];
2023-05-30 09:18:20 -04:00
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
2022-06-23 02:57:41 -04:00
};
# Enable mosh for connecting from phone or bad internet
programs.mosh.enable = true;
};
}