From f9cc5df2661eb4fc073c041f298073b89f91210b Mon Sep 17 00:00:00 2001 From: Arnoud Vermeer Date: Thu, 16 Mar 2017 10:56:20 +0100 Subject: Ignore the host key checking --- lib/oxidized/input/ssh.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 9a5c508..edde6b7 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -25,7 +25,7 @@ module Oxidized @log = File.open(Oxidized::Config::Log + "/#{@node.ip}-ssh", 'w') if Oxidized.config.input.debug? port = vars(:ssh_port) || 22 if proxy_host = vars(:ssh_proxy) - proxy = Net::SSH::Proxy::Command.new("ssh #{proxy_host} -W %h:%p") + proxy = Net::SSH::Proxy::Command.new("ssh -o StrictHostKeyChecking=no #{proxy_host} -W %h:%p") end ssh_opts = { :port => port.to_i, -- cgit v1.2.1 From d21aeefb6ad3fca04d25a7af57fd9bd350a18fd8 Mon Sep 17 00:00:00 2001 From: Arnoud Vermeer Date: Thu, 16 Mar 2017 19:28:38 +0100 Subject: Add option to disable StrictHostKeyChecking --- lib/oxidized/input/ssh.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index edde6b7..858d5cd 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -25,7 +25,10 @@ module Oxidized @log = File.open(Oxidized::Config::Log + "/#{@node.ip}-ssh", 'w') if Oxidized.config.input.debug? port = vars(:ssh_port) || 22 if proxy_host = vars(:ssh_proxy) - proxy = Net::SSH::Proxy::Command.new("ssh -o StrictHostKeyChecking=no #{proxy_host} -W %h:%p") + proxy_command = "ssh " + proxy_command += "-o StrictHostKeyChecking=no " unless secure + proxy_command += "#{proxy_host} -W %h:%p" + proxy = Net::SSH::Proxy::Command.new(proxy_command) end ssh_opts = { :port => port.to_i, -- cgit v1.2.1