tadpole: Add authorized ssh key for pinwheel

This commit is contained in:
Alexander Heldt
2024-07-20 21:45:13 +02:00
parent f59344809e
commit 03a983cd3a
4 changed files with 28 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
{ lib, config, ... }: { pkgs, lib, config, ... }:
let let
enabled = config.mod.ssh.enable; enabled = config.mod.ssh.enable;
authorizedKeysPath = "/home/alex/.ssh/authorized-keys";
in in
{ {
options = { options = {
@@ -23,7 +25,22 @@ in
}; };
}; };
environment.etc."ssh/authorized_keys_command" = {
mode = "0755";
text = ''
#!${pkgs.bash}/bin/bash
for file in ${authorizedKeysPath}/*; do
${pkgs.coreutils}/bin/cat "$file"
done
'';
};
age.secrets = { age.secrets = {
"alex.pinwheel-tadpole.pub" = {
file = ../../../../secrets/pinwheel/alex.pinwheel-tadpole.pub.age;
path = "${authorizedKeysPath}/alex.pinwheel-tadpole.pub";
};
"alex.tadpole-codeberg.org" = { "alex.tadpole-codeberg.org" = {
file = ../../../../secrets/tadpole/alex.tadpole-codeberg.org.age; file = ../../../../secrets/tadpole/alex.tadpole-codeberg.org.age;
path = "/home/alex/.ssh/alex.tadpole-codeberg.org"; path = "/home/alex/.ssh/alex.tadpole-codeberg.org";
@@ -47,6 +64,14 @@ in
path = "/etc/ssh/tadpole"; path = "/etc/ssh/tadpole";
type = "ed25519"; type = "ed25519";
}]; }];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
authorizedKeysCommand = "/etc/ssh/authorized_keys_command";
authorizedKeysCommandUser = "root";
}; };
}; };

Binary file not shown.

Binary file not shown.

View File

@@ -11,6 +11,8 @@ in {
"pinwheel/mullvad-account-history.age".publicKeys = [ pinwheel alex ]; "pinwheel/mullvad-account-history.age".publicKeys = [ pinwheel alex ];
"pinwheel/alex.pinwheel-sombrero.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-sombrero.age".publicKeys = [ pinwheel alex ];
"pinwheel/alex.pinwheel-sombrero.pub.age".publicKeys = [ pinwheel sombrero alex ]; "pinwheel/alex.pinwheel-sombrero.pub.age".publicKeys = [ pinwheel sombrero alex ];
"pinwheel/alex.pinwheel-tadpole.age".publicKeys = [ pinwheel alex ];
"pinwheel/alex.pinwheel-tadpole.pub.age".publicKeys = [ pinwheel tadpole alex ];
"pinwheel/alex.pinwheel-github.com.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-github.com.age".publicKeys = [ pinwheel alex ];
"pinwheel/alex.pinwheel-github.com.pub.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-github.com.pub.age".publicKeys = [ pinwheel alex ];
"pinwheel/alex.pinwheel-andromeda.age".publicKeys = [ pinwheel alex ]; "pinwheel/alex.pinwheel-andromeda.age".publicKeys = [ pinwheel alex ];