1
0

profiles/common-ssh: Migrate common SSH config to profile and pin SSH public hosts keys for net.clerie.de

This commit is contained in:
2025-11-16 14:22:50 +01:00
parent 2d9836f793
commit f17a94c578
5 changed files with 31 additions and 19 deletions

View File

@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
with lib;
{
options.profiles.clerie.common-ssh = {
enable = mkEnableOption "Common ssh config";
};
config = mkIf config.profiles.clerie.common-ssh.enable {
services.openssh.enable = true;
services.openssh.settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = lib.mkDefault "no";
};
services.openssh.hostKeys = lib.mkForce [
# Only create ed25519 host keys
{ type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; }
];
programs.ssh.knownHostsFiles = [
(pkgs.clerie-ssh-known-hosts + "/known_hosts")
];
};
}