Bug #5561
closedforeman-proxy run puppet over ssh doesn't work
Description
Running foreman(1.4.3) and foreman-proxy (1.5.0-0) on Rhel 6.2, I found that the only way to get puppet run over ssh to work is to remove the space between -l <user> and -i <keyfile> in puppet_ssh.rb. Otherwise, the remote system shows this in the logs (X's added). Note the extra whitespace appearing before foreman-proxy user.
May 2 14:06:04 XXXXX sshd[2430]: Invalid user foreman-proxy from X.X.X.X May 2 14:06:04 XXXXX sshd[2431]: input_userauth_request: invalid user foreman-proxy May 2 14:06:04 XXXXX sshd[2430]: Failed none for invalid user foreman-proxy from X.X.X.X port 34970 ssh2 May 2 14:06:04 XXXXX sshd[2430]: Failed password for invalid user foreman-proxy from X.X.X.X port 34970 ssh2 May 2 14:06:04 XXXXX sshd[2430]: Failed password for invalid user foreman-proxy from X.X.X.X port 34970 ssh2 May 2 14:06:04 XXXXX sshd[2431]: Connection closed by X.X.X.X
Related settings look like:
:puppet: true :puppet_provider: puppetssh :puppetssh_sudo: false :puppetssh_command: /usr/local/bin/puppet_with_sudo.sh :puppetssh_user: foreman-proxy :puppetssh_keyfile: /etc/foreman-proxy/ssh/id_rsa
If I change the code to the following, and restart, it runs just fine.
--- foreman-proxy/lib/proxy/puppet/puppet_ssh.rb.orig 2014-05-02 14:06:33.010472500 -0500
+++ foreman-proxy/lib/proxy/puppet/puppet_ssh.rb 2014-05-02 14:06:21.626366466 -0500
@@ -6,10 +6,10 @@
cmd = []
cmd.push(which('sudo')) if SETTINGS.puppetssh_sudo
cmd.push(which('ssh'))
- cmd.push("-l #{SETTINGS.puppetssh_user}") if SETTINGS.puppetssh_user
+ cmd.push("-l#{SETTINGS.puppetssh_user}") if SETTINGS.puppetssh_user
if (file = SETTINGS.puppetssh_keyfile)
if File.exists?(file)
- cmd.push("-i #{file}")
+ cmd.push("-i#{file}")
else
logger.warn("Unable to access SSH private key:#{file}, ignoring...")
end
Updated by Ohad Levy over 10 years ago
would you mind sending a PR as well?
thanks!
Updated by Anonymous over 10 years ago
I'll be happy to provide more information, but what's a PR?
Updated by Marek Hulán over 10 years ago
PR stands for Pull Request on github. For more information how to do that, see tutorial on our wiki
Updated by Marek Hulán over 10 years ago
- Category set to Puppet
- Status changed from New to Ready For Testing
Just for the reference, PR is here https://github.com/theforeman/smart-proxy/pull/154
Updated by Dominic Cleal over 10 years ago
- Target version set to 1.8.3
- Translation missing: en.field_release set to 4
Updated by Anonymous over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 442e2bdaaeca04a97cee499f23e75afe4a8923d9.
Updated by Bryan Kearney over 10 years ago
- Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1103935