* Enable SFTP support in sshd.
svn path=/nixos/trunk/; revision=7622
This commit is contained in:
parent
866d87c60b
commit
158c303e2f
@ -354,6 +354,16 @@
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name = ["services" "sshd" "allowSFTP"];
|
||||
default = true;
|
||||
description = "
|
||||
Whether to enable the SFTP subsystem in the SSH daemon. This
|
||||
enables the use of commands such as sftp(1) and sshfs.
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
name = ["services" "ntp" "enable"];
|
||||
default = true;
|
||||
|
@ -87,6 +87,7 @@ import ../upstart-jobs/gather.nix {
|
||||
inherit (pkgs) writeText openssh glibc pwdutils;
|
||||
inherit (pkgs.xorg) xauth;
|
||||
forwardX11 = config.get ["services" "sshd" "forwardX11"];
|
||||
allowSFTP = config.get ["services" "sshd" "allowSFTP"];
|
||||
})
|
||||
|
||||
# NTP daemon.
|
||||
|
@ -1,15 +1,24 @@
|
||||
{writeText, openssh, glibc, pwdutils, xauth, forwardX11}:
|
||||
{ writeText, openssh, glibc, pwdutils, xauth
|
||||
, forwardX11, allowSFTP
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
sshdConfig = writeText "sshd_config" "
|
||||
UsePAM yes
|
||||
|
||||
${if forwardX11 then "
|
||||
X11Forwarding yes
|
||||
XAuthLocation ${xauth}/bin/xauth
|
||||
" else "
|
||||
X11Forwarding no
|
||||
"}
|
||||
|
||||
${if allowSFTP then "
|
||||
Subsystem sftp ${openssh}/libexec/sftp-server
|
||||
" else "
|
||||
"}
|
||||
|
||||
";
|
||||
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user