From 622734b58b3f18da0d3cd0d83f7d3ec28dedaa39 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 16 Jan 2008 13:59:03 +0000 Subject: [PATCH] * Generate /etc/ssh/ssh_config, set ForwardX11 and XAuthLocation. svn path=/nixos/trunk/; revision=10177 --- configuration/rescue-cd.nix | 1 + etc/default.nix | 13 +++++++++++++ upstart-jobs/sshd.nix | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configuration/rescue-cd.nix b/configuration/rescue-cd.nix index 755cbf0da82..25821fd20cb 100644 --- a/configuration/rescue-cd.nix +++ b/configuration/rescue-cd.nix @@ -21,6 +21,7 @@ rec { sshd = { enable = false; + forwardX11 = false; }; xserver = { diff --git a/etc/default.nix b/etc/default.nix index d30c797c44e..6456e52f9d9 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -133,6 +133,19 @@ import ../helpers/make-etc.nix { target = "nix.conf"; # will be symlinked from /nix/etc/nix/nix.conf in activate-configuration.sh. } + { # SSH configuration. Slight duplication of the sshd_config + # generation in the sshd service. + source = pkgs.writeText "ssh_config" '' + ${if config.services.sshd.forwardX11 then '' + ForwardX11 yes + XAuthLocation ${pkgs.xorg.xauth}/bin/xauth + '' else '' + ForwardX11 no + ''} + ''; + target = "ssh/ssh_config"; + } + ] # Configuration for ssmtp. diff --git a/upstart-jobs/sshd.nix b/upstart-jobs/sshd.nix index 4e3ac2b7d02..be58b91351f 100644 --- a/upstart-jobs/sshd.nix +++ b/upstart-jobs/sshd.nix @@ -5,7 +5,8 @@ let - sshdConfig = writeText "sshd_config" " + sshdConfig = writeText "sshd_config" '' + UsePAM yes ${if forwardX11 then " @@ -20,7 +21,7 @@ let " else " "} - "; + ''; sshdUid = (import ../system/ids.nix).uids.sshd;