diff --git a/lib/beaker/ssh_connection.rb b/lib/beaker/ssh_connection.rb index 2ac958f1c8..c890ded9da 100644 --- a/lib/beaker/ssh_connection.rb +++ b/lib/beaker/ssh_connection.rb @@ -69,8 +69,13 @@ def connect_block host, user, ssh_opts, options begin @logger.debug "Attempting ssh connection to #{host}, user: #{user}, opts: #{ssh_opts}" + # Work around net-ssh 6+ incompatibilities if ssh_opts.include?(:strict_host_key_checking) && (Net::SSH::Version::CURRENT.major > 5) - ssh_opts[:paranoid] = ssh_opts.delete(:strict_host_key_checking) + strict_host_key_checking = ssh_opts.delete(:strict_host_key_checking) + + unless ssh_opts[:verify_host_key].is_a?(Symbol) + ssh_opts[:verify_host_key] ||= strict_host_key_checking ? :always : :never + end end Net::SSH.start(host, user, ssh_opts)