* Enable SFTP support in sshd.

svn path=/nixos/trunk/; revision=7622
This commit is contained in:
Eelco Dolstra 2007-01-10 17:19:17 +00:00
parent 866d87c60b
commit 158c303e2f
3 changed files with 21 additions and 1 deletions

View File

@ -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"]; name = ["services" "ntp" "enable"];
default = true; default = true;

View File

@ -87,6 +87,7 @@ import ../upstart-jobs/gather.nix {
inherit (pkgs) writeText openssh glibc pwdutils; inherit (pkgs) writeText openssh glibc pwdutils;
inherit (pkgs.xorg) xauth; inherit (pkgs.xorg) xauth;
forwardX11 = config.get ["services" "sshd" "forwardX11"]; forwardX11 = config.get ["services" "sshd" "forwardX11"];
allowSFTP = config.get ["services" "sshd" "allowSFTP"];
}) })
# NTP daemon. # NTP daemon.

View File

@ -1,15 +1,24 @@
{writeText, openssh, glibc, pwdutils, xauth, forwardX11}: { writeText, openssh, glibc, pwdutils, xauth
, forwardX11, allowSFTP
}:
let let
sshdConfig = writeText "sshd_config" " sshdConfig = writeText "sshd_config" "
UsePAM yes UsePAM yes
${if forwardX11 then " ${if forwardX11 then "
X11Forwarding yes X11Forwarding yes
XAuthLocation ${xauth}/bin/xauth XAuthLocation ${xauth}/bin/xauth
" else " " else "
X11Forwarding no X11Forwarding no
"} "}
${if allowSFTP then "
Subsystem sftp ${openssh}/libexec/sftp-server
" else "
"}
"; ";
in in