mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix ssh key behavior when passing specified private keys to ssh/scp
This commit is contained in:
parent
7f028c1947
commit
a443fe5d51
2 changed files with 16 additions and 0 deletions
|
@ -52,6 +52,14 @@ module Fog
|
|||
raise ArgumentError.new(':key_data, :keys, :password or a loaded ssh-agent is required to initialize SSH')
|
||||
end
|
||||
|
||||
if options[:key_data] || options[:keys]
|
||||
options[:keys_only] = true
|
||||
#Explicitly set these so net-ssh doesn't add the default keys
|
||||
#as seen at https://github.com/net-ssh/net-ssh/blob/master/lib/net/ssh/authentication/session.rb#L131-146
|
||||
options[:keys] = [] unless options[:keys]
|
||||
options[:key_data] = [] unless options[:key_data]
|
||||
end
|
||||
|
||||
@address = address
|
||||
@username = username
|
||||
@options = { :paranoid => false }.merge(options)
|
||||
|
|
|
@ -46,6 +46,14 @@ module Fog
|
|||
raise ArgumentError.new(':key_data, :keys, :password or a loaded ssh-agent is required to initialize SSH')
|
||||
end
|
||||
|
||||
if options[:key_data] || options[:keys]
|
||||
options[:keys_only] = true
|
||||
#Explicitly set these so net-ssh doesn't add the default keys
|
||||
#as seen at https://github.com/net-ssh/net-ssh/blob/master/lib/net/ssh/authentication/session.rb#L131-146
|
||||
options[:keys] = [] unless options[:keys]
|
||||
options[:key_data] = [] unless options[:key_data]
|
||||
end
|
||||
|
||||
@address = address
|
||||
@username = username
|
||||
@options = { :paranoid => false }.merge(options)
|
||||
|
|
Loading…
Reference in a new issue