[aklug] Re: PATH for non-interactive ssh stuff?

From: Joshua J. Kugler <joshua@eeinternet.com>
Date: Sat Aug 14 2010 - 22:05:55 AKDT

On Saturday 14 August 2010, Christopher Howard elucidated thus:
> Problem: I installed git in my HOME directory on a remote system I
> don't have root access to. Works great when I'm logged-in, but when I
> try to clone a repo over ssh, I get this: (command is being executed
> on my local computer, to clone repo on remote system where I did the
> git custom install)
>
> bash: git-upload-pack: command not found
> fatal: The remote end hung up unexpectedly
>
> What is happening is, over SSH, it can't find that binary. Its
> installed in ~/bin, but that isn't in the PATH:
>
> $ ssh myusername@myremoteserver.com echo \$PATH
> /usr/bin:/bin
>
> Adding info to the PATH in .bashrc or .profile on the remote system
> doesn't change the PATH displayed when I run the previous command.

I have this in my profile:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

There is a note at the top of .profile, though:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

Hope that helps.

j

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Aug 14 22:06:11 2010

This archive was generated by hypermail 2.1.8 : Sat Aug 14 2010 - 22:06:11 AKDT