Server/ssh: add ssh host key
This commit is contained in:
parent
a3d1a8a744
commit
befadf8ed2
1 changed files with 27 additions and 1 deletions
|
|
@ -1,4 +1,23 @@
|
|||
{...}: {
|
||||
{
|
||||
flakeSelf,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
hostSecrets = "${flakeSelf.inputs.secrets}/" + config.networking.hostName + "/";
|
||||
hostKeyPath = "/etc/ssh/everest_host_key";
|
||||
in {
|
||||
age.secrets = {
|
||||
everest-host-key = {
|
||||
file = hostSecrets + "host-private-key.age";
|
||||
path = hostKeyPath;
|
||||
mode = "0400";
|
||||
};
|
||||
"everest-host-key.pub" = {
|
||||
file = hostSecrets + "host-public-key.age";
|
||||
path = hostKeyPath + ".pub";
|
||||
};
|
||||
};
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
@ -6,6 +25,13 @@
|
|||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
};
|
||||
hostKeys = [
|
||||
{
|
||||
path = hostKeyPath;
|
||||
type = "ed25519";
|
||||
comment = "Everest host key";
|
||||
}
|
||||
];
|
||||
startWhenNeeded = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue