0

我有很多需要配置和设置的 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.消息。

实际上,我不需要安全复制,我只需要在没有用户交互的情况下为任何给定设备以批处理模式复制文件。我该怎么做?

4

2 回答 2

1

如果你只用 putty 连接到服务器一次并接受服务器的密钥,你会没事的,pscp之后就不会唠叨你了。

其他选项将是可写的 smb 共享(或 nfs,如果您愿意的话),ftp 服务器,...

于 2011-10-13T14:55:15.880 回答
0

借助plink.exe简单的方法可以实现:

echo y | "PLINK.EXE"  -pw pass user@%ip% echo foobar > nul 2>&1 || goto myError

现在我可以使用pscp而不必担心它会请求不需要的交互。

于 2011-10-14T11:40:19.163 回答