I have created the script which will execute the command in the host machine.
<target name="Testpssh">
<property name="failonerror" value="true"/>
<exec executable="cmd" failonerror="${failonerror}">
"plink -pw ${password} ${username}@${host} ${command}"/>
</exec>
</target>
I have given the host, username and pwd correctly. while running am getting error as
The server’s host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server’s key fingerprint is:
****server fingerpint here****
If you trust this host, enter “y” to add the key to
PuTTY’s cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter “n”.
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)
Connection abandoned.
any idea to overcome this problem in code? thanks in advance.
Self answered:
In putty from client machine did ssh to target machine, accepted the finger prints and then ran the ant script of mine and there’s no errors.