mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(nixos): ssh Match User blocks
This commit is contained in:
parent
4505d8b340
commit
060517bfa0
2 changed files with 72 additions and 5 deletions
|
|
@ -21,6 +21,11 @@ in {
|
|||
isNormalUser = true;
|
||||
autoSubUidGidRange = false;
|
||||
group = username;
|
||||
openssh.matchBlock.settings = {
|
||||
# PasswordAuthentication works too
|
||||
KbdInteractiveAuthentication = true;
|
||||
ForceCommand = sshJump;
|
||||
};
|
||||
};
|
||||
users.groups.${username} = {
|
||||
gid = config.users.users.${username}.uid;
|
||||
|
|
@ -28,11 +33,6 @@ in {
|
|||
|
||||
services.openssh = {
|
||||
ports = mkAfter [ sshPort ];
|
||||
extraConfig = mkAfter ''
|
||||
Match User ${username}
|
||||
KbdInteractiveAuthentication yes
|
||||
ForceCommand ${sshJump}
|
||||
'';
|
||||
};
|
||||
# required for kbd or password authentication
|
||||
security.pam.services.sshd.unixAuth = mkForce true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue