我正在尝试使用plink
以下命令建立与远程服务器的连接并删除 SIP 用户目录列表中的条目:
plink root@<server-ip> -pw pwd serctl ul rm bob
然后询问以下问题:
The server's host key is not cached. You have no guarantee
that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 1024 5d:ae:ae:ad:46:71:30:6d:0c:0e:30:e1:cd:f7:6b:90
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)
如果第一次执行该命令,则会出现此情况。如果我在脚本中执行此命令,它总是在交互式提示中询问相同的内容,但由于没有给出响应,因此会多次询问相同的内容并打印:
Store key in cache? (y/n) Connection abandoned.
从手册页普林克,我确实了解了如何使用选项覆盖交互式提示-batch
,但我想确保响应是肯定的,即y
.我如何确保它是y
明确的?有什么办法可以将其添加到命令中吗?