Files
Chickadee/modules/ssh.nix
T

35 lines
736 B
Nix
Raw Normal View History

2026-07-11 14:56:13 -04:00
{ config, lib, pkgs, ... }:
let
me = config.network.nodes.${config.network.node};
in
{
networking.firewall = {
enable = true;
2026-07-29 21:55:59 -04:00
allowedTCPPorts = [ 22 ];
2026-07-11 14:56:13 -04:00
};
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
listenAddresses = [{
2026-07-29 21:55:59 -04:00
addr = "0.0.0.0";
2026-07-11 14:56:13 -04:00
port = 22;
}];
};
2026-07-12 08:20:56 -04:00
2026-07-11 14:56:13 -04:00
users.users.root.openssh.authorizedKeys.keys = [
config.network.nodes.laptop.ssh
config.network.nodes.desktop.ssh
];
2026-07-12 08:20:56 -04:00
users.users.lilac = lib.mkIf (config.network.node != "vps") {
openssh.authorizedKeys.keys = [
config.network.nodes.laptop.ssh
config.network.nodes.desktop.ssh
];
};
2026-07-11 14:56:13 -04:00
}