blob: 7030bab8ad5985a7cecc7cf958a3efffd0f9afec (
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
30
31
32
33
34
|
{ config, lib, pkgs, ... }:
with lib; let
cfg = config.local.auth.oath;
in
{
options.local.auth.oath = {
enable = lib.mkEnableOption "pam-oath";
};
config = lib.mkIf cfg.enable {
security.pam = {
oath = {
digits = 6;
window = 30;
usersFile = "/var/trust/auth/users.oath";
};
services.sshd.oathAuth = true;
};
users.users.tunnel = {
uid = 1100;
group = "nogroup";
isSystemUser = true;
# Requiere oath
password = "tunnel";
home = "/var/empty";
shell = "${pkgs.coreutils}/bin/true";
};
};
}
|