diff options
Diffstat (limited to 'modules/ssh.nix')
| -rw-r--r-- | modules/ssh.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/ssh.nix b/modules/ssh.nix index a23dacd..30a79ad 100644 --- a/modules/ssh.nix +++ b/modules/ssh.nix @@ -7,6 +7,13 @@ enable = true; settings.PasswordAuthentication = false; }; + networking.firewall.allowedTCPPorts = [ 22 ]; + services.monit.config = '' + check process sshd with pidfile /var/run/sshd.pid + start program "${pkgs.systemd}/bin/systemctl start sshd" + stop program "${pkgs.systemd}/bin/systemctl stop sshd" + if failed port 22 protocol ssh for 2 cycles then restart + ''; } |