{"id":10848,"date":"2023-08-22T04:08:25","date_gmt":"2023-08-22T04:08:25","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=10848"},"modified":"2023-08-22T04:08:26","modified_gmt":"2023-08-22T04:08:26","slug":"ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/","title":{"rendered":"Ansible Error: Host Key checking is enabled and sshpass does not support this"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Error<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>root@DESKTOP-94AUF6U:~# ansible all -i 18.208.198.47,172.22.240.232, -m apt -a\"name=apache2 state=present\" -u ubuntu -k -b\r\nSSH password:\r\n172.22.240.232 | FAILED! => {\r\n    \"msg\": \"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 host's fingerprint to your known_hosts file to manage this host.\"\r\n}\r\n18.208.198.47 | FAILED! => {\r\n    \"msg\": \"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 host's fingerprint to your known_hosts file to manage this host.\"\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Step - 1\r\nRun following commands in each ARS\r\n$ apt update\r\n$ apt install sshpass\r\n\r\nStep - 2\r\nModify \/etc\/ansible\/ansible.cfg in ACS\r\n\r\n$ vi \/etc\/ansible\/ansible.cfg\r\n\r\n&#91;defaults]\r\nhost_key_checking = False<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Error<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>root@DESKTOP-94AUF6U:~# ansible all -i 18.208.198.47,172.22.240.232, -m apt -a\"name=apache2 state=present\" -u ubuntu -k -b\r\nSSH password:\r\n172.22.240.232 | UNREACHABLE! => {\r\n    \"changed\": false,\r\n    \"msg\": \"Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \\\"\/tmp\\\", for more error information use -vvv. Failed command was: ( umask 77 &amp;&amp; mkdir -p \\\"` echo \/home\/ubuntu\/.ansible\/tmp `\\\"&amp;&amp; mkdir \\\"` echo \/home\/ubuntu\/.ansible\/tmp\/ansible-tmp-1692676517.394163-1957-255011346482889 `\\\" &amp;&amp; echo ansible-tmp-1692676517.394163-1957-255011346482889=\\\"` echo \/home\/ubuntu\/.ansible\/tmp\/ansible-tmp-1692676517.394163-1957-255011346482889 `\\\" ), exited with result 1\",\r\n    \"unreachable\": true\r\n}\r\n18.208.198.47 | UNREACHABLE! => {\r\n    \"changed\": false,\r\n    \"msg\": \"Failed to connect to the host via ssh: Warning: Permanently added '18.208.198.47' (ED25519) to the list of known hosts.\\r\\nubuntu@18.208.198.47: Permission denied (publickey).\",\r\n    \"unreachable\": true\r\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Answer &#8211; user&#8217;s right access is not set with their directory<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"577\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png\" alt=\"\" class=\"wp-image-10849\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png 970w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5-300x178.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5-768x457.png 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Error Solution Error Answer &#8211; user&#8217;s right access is not set with their directory<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10848","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Error Solution Error Answer &#8211; user&#8217;s right access is not set with their directory\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-22T04:08:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-22T04:08:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png\" \/>\n<meta name=\"author\" content=\"rajeshkumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rajeshkumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/\"},\"author\":{\"name\":\"rajeshkumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"headline\":\"Ansible Error: Host Key checking is enabled and sshpass does not support this\",\"datePublished\":\"2023-08-22T04:08:25+00:00\",\"dateModified\":\"2023-08-22T04:08:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/\"},\"wordCount\":28,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/image-5.png\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/\",\"name\":\"Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/image-5.png\",\"datePublished\":\"2023-08-22T04:08:25+00:00\",\"dateModified\":\"2023-08-22T04:08:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/image-5.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/image-5.png\",\"width\":970,\"height\":577},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ansible Error: Host Key checking is enabled and sshpass does not support this\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\",\"name\":\"rajeshkumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"caption\":\"rajeshkumar\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/rajeshkumar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/","og_locale":"en_US","og_type":"article","og_title":"Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy","og_description":"Error Solution Error Answer &#8211; user&#8217;s right access is not set with their directory","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/","og_site_name":"scmGalaxy","article_published_time":"2023-08-22T04:08:25+00:00","article_modified_time":"2023-08-22T04:08:26+00:00","og_image":[{"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png","type":"","width":"","height":""}],"author":"rajeshkumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rajeshkumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/"},"author":{"name":"rajeshkumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"headline":"Ansible Error: Host Key checking is enabled and sshpass does not support this","datePublished":"2023-08-22T04:08:25+00:00","dateModified":"2023-08-22T04:08:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/"},"wordCount":28,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/","name":"Ansible Error: Host Key checking is enabled and sshpass does not support this - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png","datePublished":"2023-08-22T04:08:25+00:00","dateModified":"2023-08-22T04:08:26+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2023\/08\/image-5.png","width":970,"height":577},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/ansible-error-host-key-checking-is-enabled-and-sshpass-does-not-support-this\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Ansible Error: Host Key checking is enabled and sshpass does not support this"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361","name":"rajeshkumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","caption":"rajeshkumar"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/rajeshkumar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=10848"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10848\/revisions"}],"predecessor-version":[{"id":10850,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/10848\/revisions\/10850"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=10848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=10848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=10848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}