【问题标题】:server host key not catched - ant script exec未捕获服务器主机密钥 - ant script exec
【发布时间】: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 脚本,没有错误。

标签: ant ssh exec


【解决方案1】:

自我回答:

在客户端机器的腻子中,对目标机器进行了 ssh,接受了指纹,然后运行了我的 ant 脚本,没有错误。

【讨论】:

    猜你喜欢
    • 2011-06-23
    • 2014-12-27
    • 2015-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-27
    • 2023-04-04
    • 2016-11-16
    相关资源
    最近更新 更多