feat: configure openssh
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
74544e5d9c
commit
c16a6ae16d
2 changed files with 30 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
./locale.nix
|
||||
./nh.nix
|
||||
./openssh.nix
|
||||
];
|
||||
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
|
|
|||
29
hosts/common/global/openssh.nix
Normal file
29
hosts/common/global/openssh.nix
Normal 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue