首页 > 系统服务 > 详细

The server's host key is not cached in the registry. You have no guarantee that the server……

时间:2016-05-20 09:56:52      阅读:2564      评论:0      收藏:0      [点我收藏+]

使用putty中的pscp.exe ,可以通过脚本方式实现windows向linux上传文件,但pscp.exe第一次运行时必须手工输入确认信息,本文主要解决掉初次运行时的人工交互,彻底实现静默运行。这个方案可以用于很多任务计划程序中

错误信息: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.

解决方案:

1. 新建一个文本文件,输入 Y 然后换行

例如:confirm.txt:

Y
<空行>

2. 在pscp.exe命令的最后以文件方式重定向输入Y,示例如下:

< confirm.txt

说明,重定向输入符 ‘<‘ 将重定向文本内容作为pscp命令的输入,自动回答运行pscp时候的提示

3 下面是我自己的一个例子,仅供参考

::设置运行时间
set datevar=%date:~0,4%%date:~5,2%%date:~8,2%
::开始运行pscp,并以文件形式进行重定向输入
c:\vminfo\PSCP.EXE -q -pw x33+esaC c:\Vminfo\test\RunningTask* root@10.200.108.55:/Vminfo/ < C:\VMInfo\test\confirm.bat
::打印日志
echo "######EndTime--%datevar%:%time%########" >> c:\VMInfo\test\Running1.log

 

参考:

http://www.sqlservercentral.com/Forums/Topic281954-9-3.aspx

批处理(bat)利用set p与重定向输入分行获取文本内容

The server's host key is not cached in the registry. You have no guarantee that the server……

原文:http://www.cnblogs.com/lizhaoxian/p/5510909.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!