Added PermitRootLogin option for sshd

svn path=/nixos/trunk/; revision=11121
This commit is contained in:
Sander van der Burg 2008-03-14 12:53:14 +00:00
parent 95d41d5e27
commit 6c8bae53c1
3 changed files with 18 additions and 1 deletions

View File

@ -797,6 +797,15 @@
";
};
permitRootLogin = mkOption {
default = "yes";
description = "
Whether the root user can login using ssh. Valid options
are <command>yes</command>, <command>without-password</command>,
<command>forced-commands-only</command> or
<command>no</command>
";
};
};
lshd = {

View File

@ -137,6 +137,7 @@ let
inherit nssModulesPath;
forwardX11 = config.services.sshd.forwardX11;
allowSFTP = config.services.sshd.allowSFTP;
permitRootLogin = config.services.sshd.permitRootLogin;
})
# GNU lshd SSH2 deamon.

View File

@ -1,8 +1,13 @@
{ writeText, openssh, glibc, xauth
, nssModulesPath
, forwardX11, allowSFTP
, forwardX11, allowSFTP, permitRootLogin
}:
assert permitRootLogin == "yes" ||
permitRootLogin == "without-password" ||
permitRootLogin == "forced-commands-only" ||
permitRootLogin == "no";
let
sshdConfig = writeText "sshd_config" ''
@ -21,6 +26,8 @@ let
" else "
"}
PermitRootLogin ${permitRootLogin}
'';
sshdUid = (import ../system/ids.nix).uids.sshd;