Revert "hosts/ssh: replace pam_ssh_agent_auth with pam_rssh"

This reverts commit b27c2ee029.
This commit is contained in:
Gabriel Fontes
2024-08-19 11:13:01 -03:00
parent bed2a43342
commit a45b0087f5
+3 -16
View File
@@ -2,7 +2,6 @@
outputs,
lib,
config,
pkgs,
...
}: let
hosts = lib.attrNames outputs.nixosConfigurations;
@@ -55,20 +54,8 @@ in {
};
# Passwordless sudo when SSH'ing with keys
security.pam.services.sudo = {config, ...}: {
rules.auth.rssh = {
order = config.rules.auth.ssh_agent_auth.order - 1;
control = "sufficient";
modulePath = "${pkgs.pam_rssh}/lib/libpam_rssh.so";
settings.authorized_keys_command =
pkgs.writeShellScript "get-authorized-keys"
''
cat "/etc/ssh/authorized_keys.d/$1"
'';
};
security.pam.sshAgentAuth = {
enable = true;
authorizedKeysFiles = ["/etc/ssh/authorized_keys.d/%u"];
};
# Keep SSH_AUTH_SOCK when sudo'ing
security.sudo.extraConfig = ''
Defaults env_keep+=SSH_AUTH_SOCK
'';
}