【发布时间】:2012-09-11 05:03:35
【问题描述】:
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
服务器的主机密钥未缓存在注册表中。你
无法保证服务器是您的计算机
认为是。
服务器的密钥指纹是:
****服务器指纹在这里****
如果您信任此主机,请输入“y”将密钥添加到
PuTTY的缓存并进行连接。
如果您只想继续连接一次,而无需
将密钥添加到缓存中,输入“n”。
如果您不信任此主机,请按 Return 放弃
连接。
将密钥存储在缓存中? (是/否)
已放弃连接。
any idea to overcome this problem in code? thanks in advance.
【问题讨论】:
-
欢迎任何建议或代码更改!
-
问题已解决。在客户端机器完成 ssh 到目标机器的腻子中,接受指纹,然后运行我的 ant 脚本,没有错误。