refactor(ssh): consolidate sshd enable and port 22 into modules/ssh.nix
The daemon enable and the firewall port were duplicated in each sshd host (T400, Mac Pro, RPi5). Move both into modules/ssh.nix so importing it both hardens and enables sshd; drop the per-host copies. No build change: the three hosts evaluate to identical derivations. Closes #51
This commit is contained in:
+6
-3
@@ -1,8 +1,11 @@
|
||||
# Key-only sshd hardening, imported by hosts that run sshd (T400, Mac Pro,
|
||||
# RPi5). Authorized keys are owned per-user by the registry (modules/users.nix),
|
||||
# not here.
|
||||
# sshd for the hosts that run it (T400, Mac Pro, RPi5): enable the daemon, open
|
||||
# port 22, and apply a key-only policy. Authorized keys are owned per-user by the
|
||||
# registry (modules/users.nix), not here.
|
||||
{ ... }:
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
services.openssh.settings = {
|
||||
PasswordAuthentication = false; # keys only
|
||||
KbdInteractiveAuthentication = false; # no keyboard-interactive fallback
|
||||
|
||||
Reference in New Issue
Block a user