mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-08-28 02:24:12 -05:00
Revert "hosts/ssh: replace pam_ssh_agent_auth with pam_rssh"
This reverts commit b27c2ee029.
This commit is contained in:
@@ -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
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user