[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: remote command issue
[Thread Prev] | [Thread Next]
- Subject: Re: remote command issue
- From: Audrius Butkevicius <audrius.butkevicius@xxxxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 07 Jul 2014 11:50:56 +0100
- To: zengen.scott8341@xxxxxxxxx
- Cc: libssh@xxxxxxxxxx
On 07/07/2014 11:16, Scott Tseng wrote:
Hi Audrius. I am using libssh as the client.the directory of the executable is set on the server side path environment.
It might be set on login time, an example with OpenSSH client/server: user@audrius:~$ ssh localhost env | wc -l 11 user@audrius:~$ ssh localhost '/bin/bash -lc env' | wc -l 35The first command doesn't have a login shell, where the 2nd one does, as /bin/bash -l gives a login shell at the other end.
How exactly are you trying to run a command at the other end?Perhaps you should prefix you command with /bin/bash -lc <command> as that gives you a login shell? (Subject that you have bash)
If you are using libssh as the client, I think you can deliberately export some variables at the other end via:PATH='/bin/;/sbin/;/usr/bin/;/usr/sbin/;' ssh user@server how can i force the client to export the path? export it via libssh api?
http://api.libssh.org/master/group__libssh__channel.html#ga7aede2f9af4c494ff9e41fc08a4572f1
export the PATH on make file during the compiling? thank you scott
remote command issue | Scott Tseng <zengen.scott8341@xxxxxxxxx> |