相关疑难解决方法(0)

ssh:自动接受密钥

我写了这个小实用程序脚本:

for h in $SERVER_LIST; do ssh $h "uptime"; done
Run Code Online (Sandbox Code Playgroud)

将新服务器添加到 时$SERVER_LIST,脚本将停止:

The authenticity of host 'blah.blah.blah (10.10.10.10)' can't be established.
RSA key fingerprint is a4:d9:a4:d9:a4:d9a4:d9:a4:d9a4:d9a4:d9a4:d9a4:d9a4:d9.
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud)

我试过yes

for h in $SERVER_LIST; do yes | ssh $h "uptime"; done
Run Code Online (Sandbox Code Playgroud)

没有运气。

有没有办法参数化ssh以自动接受任何新密钥?

ssh scripts openssh

273
推荐指数
4
解决办法
38万
查看次数

标签 统计

openssh ×1

scripts ×1

ssh ×1