Servers: Remove RSA SSH keys
This commit is contained in:
parent
6555e2008e
commit
4cca387389
2 changed files with 21 additions and 12 deletions
|
@ -1,9 +1,29 @@
|
|||
{ lib, config, ... }:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
config = {
|
||||
networking.networkmanager.enable = true;
|
||||
networking.useDHCP = mkDefault true;
|
||||
networking.firewall.enable = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
StrictModes = true;
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitEmptyPasswords = "no";
|
||||
};
|
||||
|
||||
openFirewall = true;
|
||||
|
||||
hostKeys = [
|
||||
{
|
||||
comment = "Main key";
|
||||
path = "/etc/ssh/ssh_host_ed25519_key";
|
||||
type = "ed25519";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,20 +2,9 @@
|
|||
with lib;
|
||||
{
|
||||
config = {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
StrictModes = true;
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitEmptyPasswords = "no";
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
(mkIf config.services.nginx.enable 80)
|
||||
(mkIf config.services.nginx.enable 443)
|
||||
(mkIf config.services.openssh.enable 22)
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue