summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-02-19 11:35:46 +0200
committerytti <saku@ytti.fi>2016-02-19 11:35:46 +0200
commit58e51244c10b7dcc6e82573250d592777a442aca (patch)
treec4beb851e065b84bb17100323f5bb23f6111d678 /lib
parentd2bdccba2ef9a462730e4233d36d8eadb960f6be (diff)
parentf94b05616433f8c2840df7d6fa25442f92f57b7e (diff)
Merge pull request #328 from roedie/fix-sshkex
Add support to specify cipher and kex for ssh connections
Diffstat (limited to 'lib')
-rw-r--r--lib/oxidized/input/ssh.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb
index e7296b5..63d1067 100644
--- a/lib/oxidized/input/ssh.rb
+++ b/lib/oxidized/input/ssh.rb
@@ -26,12 +26,18 @@ module Oxidized
if proxy_host = vars(:proxy)
proxy = Net::SSH::Proxy::Command.new("ssh #{proxy_host} nc %h %p")
end
- @ssh = Net::SSH.start(@node.ip, @node.auth[:username], :port => port.to_i,
- :password => @node.auth[:password], :timeout => Oxidized.config.timeout,
- :paranoid => secure,
- :auth_methods => %w(none publickey password keyboard-interactive),
- :number_of_password_prompts => 0,
- :proxy => proxy)
+ ssh_opts = {
+ :port => port.to_i,
+ :password => @node.auth[:password], :timeout => Oxidized.config.timeout,
+ :paranoid => secure,
+ :auth_methods => %w(none publickey password keyboard-interactive),
+ :number_of_password_prompts => 0,
+ :proxy => proxy
+ }
+ ssh_opts[:encryption] = vars(:ssh_encryption) if vars(:ssh_encryption)
+ ssh_opts[:kex] = vars(:ssh_kex) if vars(:ssh_kex)
+
+ @ssh = Net::SSH.start(@node.ip, @node.auth[:username], ssh_opts)
unless @exec
shell_open @ssh
begin