Not familiar with libssh, but error could be, because environment gets set up differently, so running make through shell explicitly could help.
Try changing the command (make
?) to
bash -c make
If that does not work, try
bash -c "export > env.txt ; make > make_out.txt 2> make_err.txt"
Then check if those file appeared, and what they contain, that should give good hints.
If you have a working and a non-working case, then get these files from both cases, and compare them (eg. with diff -u
).
And change bash
to whatever shell you use (and in that case check if -c
is right switch to give command string, and if export
is right command to show environment), if you're not using bash.
Based on comments below: Difference in env.txt could be, because some of the environment variables only get set for interactive shells. For example, in my Ubuntu box, start of .bashrc has lines like this:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
Now if any of those needed environemnt variables are set in .bashrc after that line, and your ssh connection is non-interactive (without pseudo-tty), these don't get set.
If this is the case, move these env variable sets to ~/.profile
, or in ~/.bashrc
before such test as above. Also do man bash
, and read stuff about initialization files (like that ~/.bashrc
).
Other solution would be to make the ssh-session interactive, which I believe is documented at this page for libssh: http://api.libssh.org/master/libssh_tutor_shell.html .