profiles/common-ssh: Migrate common SSH config to profile and pin SSH public hosts keys for net.clerie.de
This commit is contained in:
29
profiles/common-ssh/default.nix
Normal file
29
profiles/common-ssh/default.nix
Normal 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")
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user