Skip to content

Commit

Permalink
sshd: provide option to disable firewall altering
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Schuermann committed Jan 18, 2018
1 parent 3fe396d commit 0a78a38
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nixos/modules/services/networking/ssh/sshd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ in
Specifies on which ports the SSH daemon listens.
'';
};

openFirewall = mkOption {
type = types.bool;
default = true;
description = ''
Whether to automatically open the specified ports in the firewall.
'';
};

listenAddresses = mkOption {
type = with types; listOf (submodule {
Expand Down Expand Up @@ -302,7 +310,7 @@ in

};

networking.firewall.allowedTCPPorts = cfg.ports;
networking.firewall.allowedTCPPorts = if cfg.openFirewall then cfg.ports else [];

security.pam.services.sshd =
{ startSession = true;
Expand Down

0 comments on commit 0a78a38

Please sign in to comment.