我需要配置和设置很多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.
消息。
实际上,我不需要安全复制,我只需要在没有用户交互的情况下为任何给定设备以批处理模式复制文件。我该怎么办?
答案 0 :(得分:1)
如果您只是使用putty连接服务器一次并接受服务器的密钥,那么一切都会好的,pscp
之后不会唠叨您。
其他选项是可写的smb共享(如果您喜欢,则为nfs),ftp服务器,...
答案 1 :(得分:0)
在plink.exe
的帮助下,可以简单地使用:
echo y | "PLINK.EXE" -pw pass user@%ip% echo foobar > nul 2>&1 || goto myError
现在我可以使用pscp
而无需担心它会请求不受欢迎的互动。