zoukankan      html  css  js  c++  java
  • 使用plink在缓存中自动存储服务器主机密钥

    使用plink在缓存中自动存储服务器主机密钥

    来源  https://serverfault.com/questions/420526/auto-storing-server-host-key-in-cache-with-plink

    我一直在尝试使用plink发出命令以从外部服务器检索信息。请注意,这些plink命令从不希望用户输入的二进制文件中运行。是否有一个标志可以让我覆盖此错误消息并继续执行程序输出?

    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 rsa2 key fingerprint is:
    ssh-rsa 2048 **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
    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)

    尝试在脚本前添加:

    echo y | plink -ssh root@REMOTE_IP_HERE "exit"
    

    这将管道y通过角色stdinplink当你在高速缓存中存储的关键?(y / n)提示,允许所有其他plink命令通过而无需用户输入。exit建立SSH会话后,该命令将关闭SSH会话,从而允许plink运行以下命令。

    这是一个示例脚本,该脚本将外部服务器的Unix时间写入本地文件:

    echo y | plink -ssh root@REMOTE_IP_HERE "exit"
    plink -ssh root@REMOTE_IP_HERE "date -t" > remote_time.tmp
    

    管道参考:http : //tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html

    ========= End

  • 相关阅读:
    h5红包雨
    Reflect
    el-dialog对话弹框中根据后台数据无限制添加el-select标签,并进行展示,搜索,删除
    jQuery伪分页效果
    canvas实现验证码
    jQuery四叶草菜单效果,跟360杀毒软件差不多
    事件
    传参
    在shell script中进行数值运算的两种方法
    为maven插件设置参数的三种方法
  • 原文地址:https://www.cnblogs.com/lsgxeva/p/14222739.html
Copyright © 2011-2022 走看看