System/modules/linux/services/ssh.nix

27 lines
581 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;
}];
2022-06-23 02:57:41 -04:00
permitRootLogin = "no";
passwordAuthentication = false;
};
# Enable mosh for connecting from phone or bad internet
programs.mosh.enable = true;
};
}