Not able to run linux command which requires root permission from java class
<p>I am not able to run the command from java that run properly from root in putty console.</p>

<p>I want to run my customized project specific command from java. This command run properly from putty console but i am getting error "Host key verification failed" while running it from  java. i login in my putty for the ip (10.35.29.209) and rebootnpm is my project specific command.</p>

<p>below is my code.</p>

<pre><code>         String[] cm = {
                 "ssh",
                 "root@10.35.29.209" ,
                 "rebootnpm"

                 };

        Process p1 = Runtime.getRuntime().exec(cm);

        log.debug("done the command");
        InputStream inStream1 = p1.getInputStream();
        InputStreamReader inReader1 = new InputStreamReader(inStream1);
        BufferedReader br1 = new BufferedReader(inReader1);
        String line1 = null;
        while ( (line1 = br1.readLine())  != null )
        {
            log.debug("output lines: "+line1);
        }
        InputStream errStream1 = p1.getErrorStream();
        InputStreamReader errReader1 = new InputStreamReader(errStream1);
        BufferedReader errbr1 = new BufferedReader(errReader1);
        line1 = null;
        while ( (line1 = errbr1.readLine())  != null )
        {
            log.debug("error--&gt;&gt;"+line1);
        }

        int exitVal1 = p1.waitFor();
        log.debug("exit val = " + exitVal1 );
</code></pre>

<p>I need urgent help and will be thankful on this if anyone can answer it. is there any other way to do the same from above code?</p>
