Re: Running unix shell script from remote java app
Gordon Beaton wrote:
On 12 Sep 2006 01:34:51 -0700, mwmann wrote:
I get the same problem, when I run the wrapper from unix, correct
output in tmp file is generated, when I run the warpper from my java
tool, not all output is generated in tmp file.
One or more of the commands in the script are testing whether they are
running in a terminal, and adjusting their output accordingly. This
isn't entirely uncommon behaviour. Perhaps there are flags to tell
them not to do so, or flags you can pass to your ssh library to force
it to create a psuedo-tty for the remote process.
/gordon
Probably the correct answer there by gordon.
Something else to consider: If all you are trying to do is to secure
your system against user access, just make new accounts for the junior
technicians on the machine in question. Give the accounts, like, no
privileges at all. Then write some wrapper scrips for the commands to
be executed, and drop the wrappers in a new directory like /bin/junior.
Give the newbie techs x access to /bin/junior and you're done.
Not automated, but secure. you might want to do this anyway, as the
java program you are writing could be a security hole too. You're just
kind of obfuscating the problem by using a program, not really closing
the hole. I mean someone could de-compile the Java program to get any
passwords or certificates you use inside, right?