From b01ef924375332b3cf8842d17fff24c4116b637f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 26 Jan 2007 15:32:49 +0000 Subject: [PATCH] * Use pam_env to set the PATH for SSH logins. This allows non-interactive ssh sessions (such as "ssh host command") to work properly. This should probably be used for other kinds of logins as well. svn path=/nixos/trunk/; revision=7799 --- system/etc.nix | 6 ++++++ system/etc/pam.d/sshd | 1 + 2 files changed, 7 insertions(+) diff --git a/system/etc.nix b/system/etc.nix index 8d023dff05c..029f651c5e2 100644 --- a/system/etc.nix +++ b/system/etc.nix @@ -5,6 +5,10 @@ let optional = option: file: if config.get option then [file] else []; + defaultEnv = pkgs.writeText "environment" " + PATH=${systemPath}/bin:${systemPath}/sbin + "; + in import ../helpers/make-etc.nix { @@ -98,6 +102,7 @@ import ../helpers/make-etc.nix { pkgs.xorg.fontbh100dpi pkgs.xorg.fontbhlucidatypewriter100dpi pkgs.ttf_bitstream_vera + pkgs.corefonts pkgs.freefont_ttf ]; buildInputs = [pkgs.libxslt]; @@ -130,6 +135,7 @@ import ../helpers/make-etc.nix { then pkgs.pam_ldap else "/no-such-path"; inherit (pkgs.xorg) xauth; + inherit defaultEnv; }; target = "pam.d/" + program; } diff --git a/system/etc/pam.d/sshd b/system/etc/pam.d/sshd index c3fad16bbef..e77a987ea2a 100644 --- a/system/etc/pam.d/sshd +++ b/system/etc/pam.d/sshd @@ -2,3 +2,4 @@ auth include common-auth account include common-account password include common-password session include common-session +session optional pam_env.so envfile=@defaultEnv@