feat: configure openssh

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2024-08-29 09:36:15 +02:00
parent 74544e5d9c
commit c16a6ae16d
Signed by: lander
GPG key ID: 0142722B4B0C536F
2 changed files with 30 additions and 0 deletions

View file

@ -13,6 +13,7 @@
./locale.nix
./nh.nix
./openssh.nix
];
home-manager.useGlobalPkgs = true;

View file

@ -0,0 +1,29 @@
# adapted from github.com:Misterio77/nix-config
{ outputs, lib, config, ...}:
let
hosts = lib.attrNames outputs.nixosConfigurations;
in {
services.openssh = {
enable = true;
# Harden
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
# Automatically remove stale sockets
StreamLocalBindUnlink = "yes";
# Allow forwarding ports to everywhere
GatewayPorts = "clientspecified";
};
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
rounds = 100;
}
];
};
}