[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: remote command issue


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
35

The 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)


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?
If you are using libssh as the client, I think you can deliberately export some variables at the other end via:
http://api.libssh.org/master/group__libssh__channel.html#ga7aede2f9af4c494ff9e41fc08a4572f1


export the PATH on make file during the compiling?

thank you

scott


References:
remote command issueScott Tseng <zengen.scott8341@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org