fix(ssh): document hardware-backed SSH keys and set up backup key
This commit is contained in:
@@ -17,13 +17,15 @@ in
|
||||
};
|
||||
|
||||
# auto generate authorized_keys from `authorizedHosts`
|
||||
config.users.users.${username}.openssh.authorizedKeys.keys = lib.flatten (
|
||||
map (
|
||||
hostname:
|
||||
let
|
||||
keyFile = ../../hosts/${hostname}/ssh_user.pub;
|
||||
in
|
||||
lib.optionals (builtins.pathExists keyFile) (lib.splitString "\n" (builtins.readFile keyFile))
|
||||
) ((builtins.filter (h: h != config.host.name) adminHosts) ++ config.ssh.authorizedHosts)
|
||||
);
|
||||
config.users.users.${username}.openssh.authorizedKeys.keys =
|
||||
lib.flatten (
|
||||
map (
|
||||
hostname:
|
||||
let
|
||||
keyFile = ../../hosts/${hostname}/ssh_user.pub;
|
||||
in
|
||||
lib.optionals (builtins.pathExists keyFile) (lib.splitString "\n" (builtins.readFile keyFile))
|
||||
) ((builtins.filter (h: h != config.host.name) adminHosts) ++ config.ssh.authorizedHosts)
|
||||
)
|
||||
++ lib.splitString "\n" (builtins.readFile ./ssh_bak.pub);
|
||||
}
|
||||
|
||||
1
modules/ssh/ssh_bak.pub
Normal file
1
modules/ssh/ssh_bak.pub
Normal file
@@ -0,0 +1 @@
|
||||
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAINg9dwrE10NQ7WMhL/hFJHRNFlDedvloCm9E4XEfnpStAAAABHNzaDo= backup
|
||||
Reference in New Issue
Block a user