Welcome Guest | Login

Default PATH when logging in via SSH

Here's my situation. I use Git for version control. I've got a repo in my $HOME on the server, and I want to push to it from my local machine, over ssh.

The problem is that this requires a program called git-receive-pack on the server, which I have installed with the rest of the git tools in $HOME/bin. However, apparently when connecting via ssh to a non-interactive session, $HOME/bin isn't in $PATH, because I get an error message from the server end indicating that git-receive-pack couldn't be found.

I tried putting

PATH=$PATH:/home/<myusername>/bin

in ~/.ssh/environment, but that didn't help.

Any hints are appreciated. (I can get it to work by using one of git-push's options that allows me to specify the path to git-receive-pack on the server, but I'd rather not have to keep doing that.)

2008-03-25 04:22 PM

Hi Ody,

I think the line PATH=$PATH:/home/<myusername>/bin you entered is in  wrong file (.ssh/environment). You please try to put the same line that you have entered in .ssh/environment to .bashrc.
I think it will resolve your issue.

2008-03-25 06:23 PM

That worked, thanks.

2008-03-25 08:43 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!