nixos/services/openssh.nix

26 lines
661 B
Nix
Raw Normal View History

2019-02-26 13:44:40 +01:00
{ config, lib, pkgs, ... }:
# For reference:
# https://infosec.mozilla.org/guidelines/openssh.html
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
with lib;
mkIf (elem "openssh" config.machine.services) {
2019-02-26 13:44:40 +01:00
services.openssh = {
enable = true;
kexAlgorithms = [ "curve25519-sha256@libssh.org" ];
sftpFlags = [ "-f AUTHPRIV" "-l INFO" ];
2019-02-26 13:44:40 +01:00
startWhenNeeded = true;
challengeResponseAuthentication = false;
passwordAuthentication = false;
permitRootLogin = "no";
extraConfig = ''
UsePAM no
AllowUsers derped git nix-ssh
UsePrivilegeSeparation sandbox
LogLevel VERBOSE
2019-02-26 13:44:40 +01:00
'';
};
}