From 4d0977c482060ac160412477f4d28e54dcd9508c Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Tue, 20 Oct 2026 21:59:21 +0200 Subject: [PATCH] backwards/pinwheel: Add SSH key for backwards to access pinwheel Pinwheel's sshd had no way to accept keys from other hosts. Give it the same `authorizedKeysCommand` setup as backwards and manatee, and authorize a new `alex.backwards-pinwheel` key that backwards uses for `ssh pinwheel`. --- hosts/backwards/modules/ssh/default.nix | 20 +++++++++++++++++ hosts/pinwheel/modules/ssh/default.nix | 21 ++++++++++++++++++ secrets/backwards/alex.backwards-pinwheel.age | Bin 0 -> 786 bytes .../backwards/alex.backwards-pinwheel.pub.age | Bin 0 -> 537 bytes secrets/secrets.nix | 2 ++ 5 files changed, 43 insertions(+) create mode 100644 secrets/backwards/alex.backwards-pinwheel.age create mode 100644 secrets/backwards/alex.backwards-pinwheel.pub.age 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 0000000000000000000000000000000000000000..e285517b95c379bf2d3636f932e6a24eed48da2a GIT binary patch literal 786 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCR+C^hg1PglrG4Aalf zkMs=A3^GkC@CgquFYqleO$yHNb1u(`GiPy#roLqe3Sygnh{NGwuGy24{@DlawG`PX)_(uM_``Zu z%o6(uxw;%i?gx@n8pQhN`u+L7T0?jai;163_O8XYZecfM-w0hl^i{b^wz_Kd#rf89 zDvy}5v)6UVu{Vjo7M47+*m0(UU&8*leIhBJ4n+Gdi`)9Hz4!KpzFhZ>wWq zXY-cYI?vO;dY(+P=4NOtYoFxc&1dDGwaO^`-wr1X^Y}p(BrM%y^XSMvbRFBB5S4;EZ{^jkHw4x+NSz^UK X1FJHjg(vTadMjobIIQbdUMLO#&WKI| literal 0 HcmV?d00001 diff --git a/secrets/backwards/alex.backwards-pinwheel.pub.age b/secrets/backwards/alex.backwards-pinwheel.pub.age new file mode 100644 index 0000000000000000000000000000000000000000..5016233bb3a9fa8d8220bbef0d3b44fdb6800a88 GIT binary patch literal 537 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCR+C^hg1PggK0^~=r; z4Rj844hqn=w5$kp_A9lph;;GtwKUGxPxW&vG9!4NOZe@l6XdG(fkltRf&ODqW#UyP(X~)xsw%I59HN z%*W8jGf=-uyP_)7q}VmX#Um%swIs(g#6KV~+=8nzyD}rK$g9fBFg3l@HOvPk3fZrEb|agfAjF1()661B-M^ z11A#?#}L!Jq)2~{ykah0U0sEc2+txfpY;4Fr-)4Fw8&z&aKm(iFq6zmiz=Taw{#cR zV%KsvV`paK?WD!K+V=!#9(WA^ DBUQcQ literal 0 HcmV?d00001 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 ];