Merge pull request #857 from bashims/forward_ports-keys_only

enable IdentitiesOnly when config.ssh.keys_only is specified.
This commit is contained in:
Dmitry Vasilets 2018-02-02 17:45:09 +01:00 committed by GitHub
commit 50f68cc018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,7 @@ module VagrantPlugins
StrictHostKeyChecking=no StrictHostKeyChecking=no
PasswordAuthentication=no PasswordAuthentication=no
ForwardX11=#{ssh_info[:forward_x11] ? 'yes' : 'no'} ForwardX11=#{ssh_info[:forward_x11] ? 'yes' : 'no'}
IdentitiesOnly=#{ssh_info[:keys_only] ? 'yes' : 'no'}
) + ssh_info[:private_key_path].map do |pk| ) + ssh_info[:private_key_path].map do |pk|
"IdentityFile='\"#{pk}\"'" "IdentityFile='\"#{pk}\"'"
end).map { |s| s.prepend('-o ') }.join(' ') end).map { |s| s.prepend('-o ') }.join(' ')