2024-09-02 18:31:19 +05:30
|
|
|
{
|
2024-10-05 20:53:47 +05:30
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2024-09-02 18:31:19 +05:30
|
|
|
options.snowflake.core.sshd = {
|
|
|
|
enable = lib.mkEnableOption "Enable core sshd configuration";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.snowflake.core.sshd.enable {
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
# Disable password auth and root login.
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
PermitRootLogin = "no";
|
2024-10-05 20:53:47 +05:30
|
|
|
KbdInteractiveAuthentication = false;
|
|
|
|
PermitEmptyPasswords = false;
|
|
|
|
Protocol = 2;
|
|
|
|
MaxAuthTries = 3;
|
|
|
|
ChallengeResponseAuthentication = false;
|
|
|
|
AllowTcpForwarding = "yes";
|
2024-09-02 18:31:19 +05:30
|
|
|
};
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable mosh for access over spotty networks.
|
|
|
|
programs.mosh.enable = true;
|
|
|
|
programs.ssh.startAgent = true;
|
|
|
|
};
|
|
|
|
}
|