dot.nix/hosts/global/core/ssh.nix

22 lines
535 B
Nix

{ lib, ... }:
{
programs.ssh.startAgent = true;
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
AllowUsers = null; # everyone
PasswordAuthentication = lib.mkDefault false;
PermitRootLogin = lib.mkDefault "no";
KbdInteractiveAuthentication = false;
# Automatically remove stale sockets
StreamLocalBindUnlink = "yes";
# Allow forwarding ports to everywhere
GatewayPorts = "clientspecified";
};
};
networking.firewall.allowedTCPPorts = [ 22 ];
}