Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use :never in ssh/scp verify_host_key option #253

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/fog/core/scp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ def initialize(address, username, options)

@address = address
@username = username
@options = { :paranoid => false, :verify_host_key => false }.merge(options)
@options = { :paranoid => false, :verify_host_key => :never }.merge(options)
@options.delete(:paranoid) if Net::SSH::VALID_OPTIONS.include? :verify_host_key
@options[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
end

def upload(local_path, remote_path, upload_options = {}, &block)
Expand Down
3 changes: 2 additions & 1 deletion lib/fog/core/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ def merge_default_options_into(options)

# net-ssh has deprecated :paranoid in favor of :verify_host_key
# https://github.com/net-ssh/net-ssh/pull/524
opts = { :paranoid => false, :verify_host_key => false }.merge(options)
opts = { :paranoid => false, :verify_host_key => :never }.merge(options)
if Net::SSH::VALID_OPTIONS.include? :verify_host_key
opts.delete(:paranoid)
end
opts[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
opts
end

Expand Down