Automatically add administrative users to openssh's AllowUsers list.
This commit is contained in:
parent
d2c6b3931e
commit
ed892d1fb8
1 changed files with 5 additions and 2 deletions
|
@ -15,9 +15,12 @@ mkIf (elem "openssh" config.machine.services) {
|
||||||
challengeResponseAuthentication = false;
|
challengeResponseAuthentication = false;
|
||||||
passwordAuthentication = false;
|
passwordAuthentication = false;
|
||||||
permitRootLogin = "no";
|
permitRootLogin = "no";
|
||||||
extraConfig = ''
|
extraConfig = let users = concatMapStrings (user: "${user.name} ") config.machine.administrators
|
||||||
|
+ (if config.services.gitea.enable then (config.services.gitea.user + " ") else "")
|
||||||
|
+ (if config.services.nix-serve.enable then "nix-ssh" else "");
|
||||||
|
in ''
|
||||||
UsePAM no
|
UsePAM no
|
||||||
AllowUsers derped git nix-ssh
|
AllowUsers ${users}
|
||||||
UsePrivilegeSeparation sandbox
|
UsePrivilegeSeparation sandbox
|
||||||
LogLevel VERBOSE
|
LogLevel VERBOSE
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue