From 6a6e7d351693d71670f2c06869b4481b4db7bc24 Mon Sep 17 00:00:00 2001 From: Chibuikem Amaechi Date: Thu, 1 Feb 2018 12:57:35 -0600 Subject: Ignore user SSH key authentication if password is given Signed-off-by: Chibuikem Amaechi --- lib/chef/knife/ssh.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/chef/knife/ssh.rb') diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index f8e630603c..885ebc4faa 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -560,11 +560,6 @@ class Chef config[:ssh_password] = get_stripped_unfrozen_value(ssh_password || Chef::Config[:knife][:ssh_password]) end - - # CHEF-4342 Diable host key verification if a password has been given. - if config[:ssh_password] - config[:host_key_verify] = false - end end def configure_ssh_identity_file @@ -581,8 +576,13 @@ class Chef configure_user configure_password @password = config[:ssh_password] if config[:ssh_password] - configure_ssh_identity_file - configure_ssh_gateway_identity + + # If a password was not given, check for SSH identity file. + if !@password + configure_ssh_identity_file + configure_ssh_gateway_identity + end + configure_gateway configure_session -- cgit v1.2.1