Bug #6022
closedpuppetssh fails due to host key prompt when trying to do puppetrun
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.
Updated by Dominic Cleal about 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
Updated by Royee Tager about 9 years ago
Hi,
Do you have any updates regarding this issue?
Updated by Francois Laupretre about 8 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.
Updated by The Foreman Bot about 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
Updated by Anonymous about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 846218ef5292b6baf92905da831515b80e19825f.