Project

General

Profile

Actions

Bug #6022

closed

puppetssh fails due to host key prompt when trying to do puppetrun

Added by Stephen Herd almost 10 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Puppet
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I've configured settings.yml to allow puppet runs over ssh

But on the remote server I just get "Connection Closed by x.x.x.x". After playing around with things manually (enabling login for foreman-proxy and running commands myself), I discovered that foreman-proxy was silently failing because of the host key prompt.

I added:
cmd = []
cmd.push(which('sudo')) if SETTINGS.puppetssh_sudo
cmd.push(which('ssh'))
cmd.push("-o StrictHostKeyChecking=no")
cmd.push("-l", "#{SETTINGS.puppetssh_user}") if SETTINGS.puppetssh_user

in

foreman-proxy/lib/proxy/puppet/puppet_ssh.rb

and everything seems to work correctly.

Actions #1

Updated by Dominic Cleal almost 10 years ago

  • Project changed from Foreman to Smart Proxy
  • Subject changed from puppetssh silently fails when trying to do puppetrun to puppetssh fails due to host key prompt when trying to do puppetrun
  • Category changed from Puppet integration to Puppet
  • Priority changed from High to Normal
Actions #2

Updated by Royee Tager over 8 years ago

Hi,

Do you have any updates regarding this issue?

Actions #3

Updated by Francois Laupretre over 7 years ago

Hi,

Fix for version 1.12.1 :

--- puppet_proxy_ssh_main.rb    2016-07-22 15:16:46.000000000 +0200
+++ puppet_proxy_ssh_main.rb.new        2016-08-09 11:19:55.241114989 +0200
@@ -28,6 +28,7 @@
     end
     cmd.push(ssh_path)

+    cmd.push('-o', 'StrictHostKeyChecking=no')
     cmd.push("-l", user) if user

     if keyfile_path

Without option, you must 'ssh' to every client manually from foreman proxy before being able to launch a remote command. So, in practice, 'StrictHostKeyChecking=no' is mandatory and should, IMHO, be inserted in the code.

Actions #4

Updated by The Foreman Bot almost 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Anonymous
  • Pull request https://github.com/theforeman/smart-proxy/pull/528 added
Actions #5

Updated by Anonymous almost 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF