On Fri, Apr 1, 2011 at 8:46 PM, Nico Kadel-Garcia <nka...@gmail.com> wrote:

> Modern versions of OpenSSH (such as the version 5 in RHEL 6 and
> contemporary Debian releases) does not read your .bashrc for non-login
> sessions. (This is actually standards compliant behavior, which
> OpenSSH version 4 did not follow.) This makes stashing an svnserve
> alias or $PATH setting unavailable going forward, and dependent on the
> typically shared 'svn' user to have this set in their path for
> svn+ssh.
>

I hit this same behavior working with a git install on a nonstandard path, a
while back.

One solution, at least on Linux, is to set "UsePAM Yes" in your sshd_config
and include "auth required pam_env.so" in the PAM settings for sshd.  (This
is the default in many distributions.)  You can then configure your custom
PATH in /etc/environment, and it *will* get read by non-interactive SSH
sessions.  Note that /etc/environment is not a shell script; the only things
you can put in there are comments and simple variable assignments.

~/.ssh/environment is also an option.  You have to turn on
PermitUserEnvironment in sshd_config for that to work.

-- 
David Brodbeck
System Administrator, Linguistics
University of Washington

Reply via email to