ssh首次连接新建服务器忽略The authenticity of host ‘xxx (xxx)’ can’t be established.确认提示的方法

新创建的服务器初次使用ssh去连接时,会弹出 The authenticity of host ‘xxx (xx)’ can’t be established.的确认提示,需要手工输入yes/no 确认是否连接。
在自动化运维时,每次脚本去连接这个新增加机器时都会卡住,都要手工确认一下,达不到无人值守目的比较麻烦。
其实在ssh连接命令行中添加 -o StrictHostKeyChecking=no 一个参数,就可以忽略这个手工敲yes的步骤,编写的自动化脚本可以顺利达到无人值守运行的目标。

Popularity: 7% [?]

Random Posts

Comments

Comments are closed.