<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[ansible连接时出现:Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this hosts fingerprint to your known_hosts file to manage this host.]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Fri, 23 Sep 2016 03:48:15 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：第一次连接ansible的host里的一堆机器时，会出标题里面的错，解决办法如下：<br/>vi /home/xiangdong/ansible/ansible.cfg<br/># uncomment this to disable SSH key host checking<br/>host_key_checking = False<br/>—————————————————————————————————————————<br/>提示输入yes 进行确认为将key字符串加入到&nbsp;&nbsp;~/.ssh/known_hosts 文件中：<br/>本篇就结合一个示例对其进行下了解。我在对之前未连接的主机进行连结时报错如下：<br/><br/>[root@361way.com ~]# ansible test -a &#039;uptime&#039;<br/>10.212.52.14 &#124; FAILED =&gt; Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.&nbsp;&nbsp;Please add this host&#039;s fingerprint to your known_hosts file to manage this host.<br/>10.212.52.16 &#124; FAILED =&gt; Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.&nbsp;&nbsp;Please add this host&#039;s fingerprint to your known_hosts file to manage this host.<br/>从上面的输出提示上基本可以了解到由于在本机的~/.ssh/known_hosts文件中并有fingerprint key串，ssh第一次连接的时候一般会提示输入yes 进行确认为将key字符串加入到&nbsp;&nbsp;~/.ssh/known_hosts 文件中。<br/><br/>方法1：<br/><br/>了解到问题原因为，我们了解到进行ssh连接时，可以使用-o参数将StrictHostKeyChecking设置为no，使用ssh连接时避免首次连接时让输入yes/no部分的提示。通过查看ansible.cfg配置文件，发现如下行：<br/><br/>[ssh_connection]<br/># ssh arguments to use<br/># Leaving off ControlPersist will result in poor performance, so use<br/># paramiko on older platforms rather than removing it<br/>#ssh_args = -o ControlMaster=auto -o ControlPersist=60s<br/>所以这里我们可以启用ssh_args 部分，使用下面的配置，避免上面出现的错误：<br/><br/>ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking＝no <br/>方法2：<br/><br/>在ansible.cfg配置文件中，也会找到如下部分：<br/><br/># uncomment this to disable SSH key host checking<br/>host_key_checking = False&nbsp;&nbsp;<br/>默认host_key_checking部分是注释的，通过找开该行的注释，同样也可以实现跳过 ssh 首次连接提示验证部分。由于配置文件中直接有该选项，所以推荐用方法2 。<br/><br/><br/>来自：http://www.361way.com/ansible-cfg/4401.html
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] ansible连接时出现:Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this hosts fingerprint to your known_hosts file to manage this host.]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>