gpt4 book ai didi

perl - 使用 Putty 到 SSH 忽略 Perl 中的所有警告

转载 作者:行者123 更新时间:2023-12-02 13:47:47 30 4
gpt4 key购买 nike

<分区>

我正在编写一个 Perl 脚本以通过 SSH 从 Windows 连接到远程 linux 和 maci 机器。为此,我正在运行 plink (putty link)命令使用 qx。问题是,当我尝试运行 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. ...... If you do not trust this host, press Return to abandon the connection. Store key in cache? (y/n)

我必须自动执行远程运行命令的过程。所以,我想以某种方式绕过这个警告。

我可以想出两种方法,但不知道如何实现这些

  • 通过一些命令行选项或其他命令以某种方式绕过 putty 本身的警告
  • 出现提示时将输入传递给 plink 的一些 Perl 方法

任何人都可以建议如何通过上述方式之一或其他一些解决方案来做到这一点。

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com