blob: d965472a668717e16805aff0c3ebfd384abe357c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.eth.services.ssh;
in {
options.eth.services.ssh = {
enable = mkEnableOption "Whether to enable SSHd with Eth's defaults.";
passwordAuthentication = mkOption {
type = types.bool;
default = false;
description = "Whether to allow password authentication. Occasionally useful, used sparingly.";
};
};
config = mkIf cfg.enable {
security.pam.enableSSHAgentAuth = true;
security.pam.services.sudo.sshAgentAuth = true;
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = cfg.passwordAuthentication;
};
};
}
|