From f383fa344ee4067a1bcbe1f6db4eb21c89fc6ca4 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Sat, 14 Mar 2020 19:50:11 -0400 Subject: [PATCH] nixos/sshd: only include AuthorizedKeysCommand and AuthorizedKeysCommandUser options if explicitly set --- nixos/modules/services/networking/ssh/sshd.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 2069ec178aa6..0664b5540d94 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -505,8 +505,10 @@ in PrintMotd no # handled by pam_motd AuthorizedKeysFile ${toString cfg.authorizedKeysFiles} - AuthorizedKeysCommand ${cfg.authorizedKeysCommand} - AuthorizedKeysCommandUser ${cfg.authorizedKeysCommandUser} + ${optionalString (cfg.authorizedKeysCommand != "none") '' + AuthorizedKeysCommand ${cfg.authorizedKeysCommand} + AuthorizedKeysCommandUser ${cfg.authorizedKeysCommandUser} + ''} ${flip concatMapStrings cfg.hostKeys (k: '' HostKey ${k.path}