Added PermitRootLogin option for sshd
svn path=/nixos/trunk/; revision=11121
This commit is contained in:
parent
95d41d5e27
commit
6c8bae53c1
@ -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 = {
|
lshd = {
|
||||||
|
@ -137,6 +137,7 @@ let
|
|||||||
inherit nssModulesPath;
|
inherit nssModulesPath;
|
||||||
forwardX11 = config.services.sshd.forwardX11;
|
forwardX11 = config.services.sshd.forwardX11;
|
||||||
allowSFTP = config.services.sshd.allowSFTP;
|
allowSFTP = config.services.sshd.allowSFTP;
|
||||||
|
permitRootLogin = config.services.sshd.permitRootLogin;
|
||||||
})
|
})
|
||||||
|
|
||||||
# GNU lshd SSH2 deamon.
|
# GNU lshd SSH2 deamon.
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
{ writeText, openssh, glibc, xauth
|
{ writeText, openssh, glibc, xauth
|
||||||
, nssModulesPath
|
, nssModulesPath
|
||||||
, forwardX11, allowSFTP
|
, forwardX11, allowSFTP, permitRootLogin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert permitRootLogin == "yes" ||
|
||||||
|
permitRootLogin == "without-password" ||
|
||||||
|
permitRootLogin == "forced-commands-only" ||
|
||||||
|
permitRootLogin == "no";
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
sshdConfig = writeText "sshd_config" ''
|
sshdConfig = writeText "sshd_config" ''
|
||||||
@ -21,6 +26,8 @@ let
|
|||||||
" else "
|
" else "
|
||||||
"}
|
"}
|
||||||
|
|
||||||
|
PermitRootLogin ${permitRootLogin}
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
sshdUid = (import ../system/ids.nix).uids.sshd;
|
sshdUid = (import ../system/ids.nix).uids.sshd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user