From 158c303e2f6b0a2989ba1cd459368de9679866be Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Jan 2007 17:19:17 +0000 Subject: [PATCH] * Enable SFTP support in sshd. svn path=/nixos/trunk/; revision=7622 --- system/options.nix | 10 ++++++++++ system/upstart.nix | 1 + upstart-jobs/sshd.nix | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/system/options.nix b/system/options.nix index 03ef575f437..b182e673b97 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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; diff --git a/system/upstart.nix b/system/upstart.nix index 7281e8d3e68..c490bc7b2fa 100644 --- a/system/upstart.nix +++ b/system/upstart.nix @@ -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. diff --git a/upstart-jobs/sshd.nix b/upstart-jobs/sshd.nix index 4988158caa1..69be033316d 100644 --- a/upstart-jobs/sshd.nix +++ b/upstart-jobs/sshd.nix @@ -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