diff --git a/hosts/backwards/modules/ssh/default.nix b/hosts/backwards/modules/ssh/default.nix index ef0ae92..eb9e551 100644 --- a/hosts/backwards/modules/ssh/default.nix +++ b/hosts/backwards/modules/ssh/default.nix @@ -31,6 +31,13 @@ in Port = 1122; }; + "pinwheel" = { + HostName = "pinwheel"; + User = "alex"; + IdentityFile = "/home/alex/.ssh/alex.backwards-pinwheel"; + Port = 1122; + }; + "git.ppp.pm" = { HostName = "git.ppp.pm"; IdentityFile = "/home/alex/.ssh/alex.backwards-git.ppp.pm"; @@ -115,6 +122,19 @@ in group = "users"; }; + "alex.backwards-pinwheel" = { + file = ../../../../secrets/backwards/alex.backwards-pinwheel.age; + path = "/home/alex/.ssh/alex.backwards-pinwheel"; + owner = "alex"; + group = "users"; + }; + "alex.backwards-pinwheel.pub" = { + file = ../../../../secrets/backwards/alex.backwards-pinwheel.pub.age; + path = "/home/alex/.ssh/alex.backwards-pinwheel.pub"; + owner = "alex"; + group = "users"; + }; + "alex.pinwheel-backwards.pub" = { file = ../../../../secrets/pinwheel/alex.pinwheel-backwards.pub.age; path = "${authorizedKeysPath}/alex.pinwheel-backwards.pub"; diff --git a/hosts/pinwheel/modules/ssh/default.nix b/hosts/pinwheel/modules/ssh/default.nix index 1f75335..6b60305 100644 --- a/hosts/pinwheel/modules/ssh/default.nix +++ b/hosts/pinwheel/modules/ssh/default.nix @@ -1,4 +1,7 @@ { pkgs, ... }: +let + authorizedKeysPath = "/home/alex/.ssh/authorized-keys"; +in { # Enable gnome-keyring at system level for PAM integration services.gnome.gnome-keyring.enable = true; @@ -154,6 +157,21 @@ owner = "alex"; group = "users"; }; + + "alex.backwards-pinwheel.pub" = { + file = ../../../../secrets/backwards/alex.backwards-pinwheel.pub.age; + path = "${authorizedKeysPath}/alex.backwards-pinwheel.pub"; + }; + }; + + environment.etc."ssh/authorized_keys_command" = { + mode = "0755"; + text = '' + #!${pkgs.bash}/bin/bash + for file in ${authorizedKeysPath}/*; do + ${pkgs.coreutils}/bin/cat "$file" + done + ''; }; services.openssh = { @@ -166,5 +184,8 @@ type = "ed25519"; } ]; + + authorizedKeysCommand = "/etc/ssh/authorized_keys_command"; + authorizedKeysCommandUser = "root"; }; } diff --git a/secrets/backwards/alex.backwards-pinwheel.age b/secrets/backwards/alex.backwards-pinwheel.age new file mode 100644 index 0000000..e285517 Binary files /dev/null and b/secrets/backwards/alex.backwards-pinwheel.age differ diff --git a/secrets/backwards/alex.backwards-pinwheel.pub.age b/secrets/backwards/alex.backwards-pinwheel.pub.age new file mode 100644 index 0000000..5016233 Binary files /dev/null and b/secrets/backwards/alex.backwards-pinwheel.pub.age differ diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 23c8cb0..aacccf1 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -56,6 +56,8 @@ in { "backwards/root.backwards.pub.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-manatee.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-manatee.pub.age".publicKeys = [ backwards manatee alex ]; + "backwards/alex.backwards-pinwheel.age".publicKeys = [ backwards alex ]; + "backwards/alex.backwards-pinwheel.pub.age".publicKeys = [ backwards pinwheel alex ]; "backwards/alex.backwards-git.ppp.pm.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-git.ppp.pm.pub.age".publicKeys = [ backwards alex ]; "backwards/wireless-network-secrets.age".publicKeys = [ backwards alex ];