24 lines
468 B
Nix
24 lines
468 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.vps.ssh;
|
|
in
|
|
{
|
|
options.vps.ssh = {
|
|
public = lib.mkEnableOption "SSH on the public interface";
|
|
};
|
|
|
|
config = {
|
|
services.openssh = {
|
|
enable = cfg.public;
|
|
ports = [ 22 ];
|
|
settings = {
|
|
PasswordAuthentication = false;
|
|
PermitEmptyPasswords = false;
|
|
KbdInteractiveAuthentication = false;
|
|
PermitRootLogin = "no";
|
|
PubkeyAuthentication = true;
|
|
};
|
|
};
|
|
};
|
|
}
|