summary refs log tree commit diff
path: root/nixos/modules/services/networking/ssh
diff options
context:
space:
mode:
authorIzorkin <Izorkin@gmail.com>2018-05-17 20:33:09 +0300
committerIzorkin <Izorkin@gmail.com>2018-05-19 11:52:00 +0300
commitad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696 (patch)
treece51a546945dcd55df42cf3af77d673421811d0b /nixos/modules/services/networking/ssh
parentdd2b5b9400f7181c4babc4e7366eee846b2f74ab (diff)
downloadnixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar.gz
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar.bz2
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar.lz
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar.xz
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.tar.zst
nixpkgs-ad11b960e9bdcfcb41a0bce2bf3d84c4d9d56696.zip
sshd: add custom options
Diffstat (limited to 'nixos/modules/services/networking/ssh')
-rw-r--r--nixos/modules/services/networking/ssh/sshd.nix36
1 files changed, 33 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix
index aab1203086c..902e759f3a3 100644
--- a/nixos/modules/services/networking/ssh/sshd.nix
+++ b/nixos/modules/services/networking/ssh/sshd.nix
@@ -272,6 +272,31 @@ in
         '';
       };
 
+      logLevel = mkOption {
+        type = types.enum [ "QUIET" "FATAL" "ERROR" "INFO" "VERBOSE" "DEBUG" "DEBUG1" "DEBUG2" "DEBUG3" ];
+        default = "VERBOSE";
+        description = ''
+          Gives the verbosity level that is used when logging messages from sshd(8). The possible values are:
+          QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is VERBOSE. DEBUG and DEBUG1
+          are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. Logging with a DEBUG level
+          violates the privacy of users and is not recommended.
+
+          LogLevel VERBOSE logs user's key fingerprint on login.
+          Needed to have a clear audit track of which key was used to log in.
+        '';
+      };
+
+      useDns = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Specifies whether sshd(8) should look up the remote host name, and to check that the resolved host name for
+          the remote IP address maps back to the very same IP address.
+          If this option is set to no (the default) then only addresses and not host names may be used in
+          ~/.ssh/authorized_keys from and sshd_config Match Host directives.
+        '';
+      };
+
       extraConfig = mkOption {
         type = types.lines;
         default = "";
@@ -426,9 +451,14 @@ in
         Ciphers ${concatStringsSep "," cfg.ciphers}
         MACs ${concatStringsSep "," cfg.macs}
 
-        # LogLevel VERBOSE logs user's key fingerprint on login.
-        # Needed to have a clear audit track of which key was used to log in.
-        LogLevel VERBOSE
+        LogLevel ${cfg.logLevel}
+
+        ${if cfg.useDns then ''
+          UseDNS yes
+        '' else ''
+          UseDNS no
+        ''}
+
       '';
 
     assertions = [{ assertion = if cfg.forwardX11 then cfgc.setXAuthLocation else true;