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 authored and adisbladis committed Jan 18, 2018
1 parent 0b559ed commit c61a9df
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nixos/modules/services/networking/ssh/sshd.nix
Expand Up @@ -21,7 +21,7 @@ let
daemon reads in addition to the the user's authorized_keys file.
You can combine the <literal>keys</literal> and
<literal>keyFiles</literal> options.
Warning: If you are using <literal>NixOps</literal> then don't use this
Warning: If you are using <literal>NixOps</literal> then don't use this
option since it will replace the key required for deployment via ssh.
'';
};
Expand Down Expand Up @@ -137,6 +137,14 @@ in
'';
};

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 {
options = {
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 c61a9df

Please sign in to comment.