added system to dirs
This commit is contained in:
24
modules/system/ssh/default.nix
Normal file
24
modules/system/ssh/default.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.system.ssh;
|
||||
in
|
||||
{
|
||||
options.system.ssh = {
|
||||
enable = lib.mkEnableOption "enables ssh";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable and configure openssh
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
PermitRootLogin = "no";
|
||||
X11Forwarding = false;
|
||||
};
|
||||
};
|
||||
# open firewall
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user