使用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……的更多相关文章

  1. 10.1 ‘The server's host key is not cached in the registry’

    10.1 ‘The server's host key is not cached in the registry’ This error message occurs when PuTTY conn ...

  2. 【sublime xftp插件】 Host key verification failed ,错误处理

    错误背景: 1.CentOS7上面作为运行环境,Coding在本机的windows环境 2.在windows上安装sublime 3,然后保存代码通过xftp保存到centos7虚机上面. 3.Cen ...

  3. SSH登录失败:Host key verification failed

    转载自:https://help.aliyun.com/knowledge_detail/41471.html 注意:本文相关 Linux 配置及说明已在 CentOS 6.5 64 位操作系统中进行 ...

  4. SSH连接时出现Host key verification failed的原因及解决方法

    SSH连接的时候Host key verification failed. [root@cache001 swftools-0.9.0]# ssh 192.168.1.90@@@@@@@@@@@@@@ ...

  5. 登录ssh时Host key verification failed错误

    工作中总是测试不同的路由设备, 路由器的ip都是 192.168.111.1 ,ssh登录的时候总是出现这个错误. macos上,错误如下 spawn ssh -p 22 root@192.168.1 ...

  6. SCP传送文件时提示No ECDSA host key is known forx.x.x.x and you have requested strict checking.问题的解决办法

    在使用SCP向其他设备传送文件时,打印如下错误: No ECDSA host key is known for x.x.x.x and you have requested strict checki ...

  7. ssh登录,Host key verification failed的几种处理方法

    - 修订历史History:  2011.05.22   初稿 - 系统: Ubuntu 10.04LTS  - 软件: SSH 使用SSH登录某台机器,有时因为server端的一些变动,会出现以下信 ...

  8. 解决ssh登录Host key verification failed

    使用SSH登录某台机器,有时因为server端的一些变动,会出现以下信息: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: R ...

  9. 阿里云服务器教程–SSH 登录时出现如下错误:Host key verification failed

    注意:本文相关 Linux 配置及说明已在 CentOS 6.5 64 位操作系统中进行过测试.其它类型及版本操作系统配置可能有所差异,具体情况请参阅相应操作系统官方文档. 问题描述 使用 SSH 登 ...

随机推荐

  1. Git Workflow简介

    1. Git WorkFlow介绍 Git Flow是构建在Git之上的一个组织软件开发活动的模型,是在Git之上构建的一项软件开发最佳实践.Git Flow是一套使用Git进行源代码管理时的一套行为 ...

  2. C++ 脑筋急转弯

    最近重新温习一下C++的基础知识,这里给大家分享一下,独痛苦不如众痛苦. 先贴出一段示例代码如下: class CTest{ public: CTest(){ ); }; ~CTest(){ if ( ...

  3. 多个tab选项卡

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  4. deeplearning.ai 作业中的Python常用命令

    1. print大法 test = Hello World print ("test:" + test) 2. math和numpy的区别:math只对单个元素,numpy会bro ...

  5. Codechef:Path Triples On Tree

    Path Triples On Tree 题意是求树上都不相交或者都相交的路径三元组数量. 发现blog里没什么树形dp题,也没有cc题,所以来丢一道cc上的树形dp题. 比较暴力,比较恶心 #inc ...

  6. bzoj:1299: [LLH邀请赛]巧克力棒

    原题:http://www.lydsy.com/JudgeOnline/problem.php?id=1299 众多dalao的题解已经很详细了:http://blog.csdn.net/wzq_qw ...

  7. BZOJ 1509: [NOI2003]逃学的小孩

    题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1509 直接求出树的直径,枚举每个点更新一遍答案. #include<cstring> ...

  8. hdu_5104 Primes Problem()

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5104 rimes Problem Time Limit: 2000/1000 MS (Java/Oth ...

  9. c语言基础学习02

    =============================================================================涉及到的知识点有:include有两种用法.{ ...

  10. list容器的C++代码实现

    #include <iostream> using namespace std; template  <class T> class mylist;//前置声明 templat ...