Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Logic change in ssh_host_key #125

Closed
wants to merge 1 commit into from

2 participants

@jmanero

Change the logic to locate SSH hostkeys slightly to try default paths
if the config file exists but doesn't have any hostkey directives.

@jmanero jmanero SSH config may not define hostkeys.
Change the logic to locate SSH hostkeys slightly to try default paths
if the config file exists but doesn't have any hostkey directives.
1eababf
@btm btm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 4, 2013
  1. @jmanero

    SSH config may not define hostkeys.

    jmanero authored
    Change the logic to locate SSH hostkeys slightly to try default paths
    if the config file exists but doesn't have any hostkey directives.
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/ohai/plugins/ssh_host_key.rb
View
14 lib/ohai/plugins/ssh_host_key.rb
@@ -52,12 +52,12 @@ def is_dsa_or_rsa?(file)
end
end
end
-else
- if keys[:ssh][:host_dsa_public].nil? && File.exists?("/etc/ssh/ssh_host_dsa_key.pub")
- keys[:ssh][:host_dsa_public] = IO.read("/etc/ssh/ssh_host_dsa_key.pub").split[1]
- end
+end
- if keys[:ssh][:host_rsa_public].nil? && File.exists?("/etc/ssh/ssh_host_rsa_key.pub")
- keys[:ssh][:host_rsa_public] = IO.read("/etc/ssh/ssh_host_rsa_key.pub").split[1]
- end
+if keys[:ssh][:host_dsa_public].nil? && File.exists?("/etc/ssh/ssh_host_dsa_key.pub")
+ keys[:ssh][:host_dsa_public] = IO.read("/etc/ssh/ssh_host_dsa_key.pub").split[1]
+end
+
+if keys[:ssh][:host_rsa_public].nil? && File.exists?("/etc/ssh/ssh_host_rsa_key.pub")
+ keys[:ssh][:host_rsa_public] = IO.read("/etc/ssh/ssh_host_rsa_key.pub").split[1]
end
Something went wrong with that request. Please try again.