2019-02-26 13:44:40 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2019-02-26 14:10:58 +01:00
|
|
|
# For reference:
|
|
|
|
# https://infosec.mozilla.org/guidelines/openssh.html
|
|
|
|
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
|
2019-03-20 02:57:59 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
mkIf (elem "openssh" config.machine.services) {
|
2019-02-26 13:44:40 +01:00
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
2019-02-26 14:10:58 +01:00
|
|
|
sftpFlags = [ "-f AUTHPRIV" "-l INFO" ];
|
2019-02-26 13:44:40 +01:00
|
|
|
startWhenNeeded = true;
|
|
|
|
challengeResponseAuthentication = false;
|
|
|
|
passwordAuthentication = false;
|
|
|
|
permitRootLogin = "no";
|
|
|
|
extraConfig = ''
|
2019-03-04 10:35:50 +01:00
|
|
|
AllowUsers derped git nix-ssh
|
2019-02-26 13:44:40 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|