From 41342dceb391a8adaf29f528aa0ec816f6318ef5 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 1 Jun 2023 13:54:51 -0700 Subject: [PATCH] Remove keyboard-interactive authentication method The keyboard-interactive authentication method was added due to a mis-reading of a reported issue where the box was not properly configured for Vagrant. This removes the keyboard-interactive authentication method which resolves a password prompting issue caused by its addition. --- plugins/communicators/ssh/communicator.rb | 6 +----- .../plugins/communicators/ssh/communicator_test.rb | 10 +++++----- .../plugins/communicators/winssh/communicator_test.rb | 8 ++++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 8835b94f2..68d36e44d 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -404,7 +404,7 @@ module VagrantPlugins # Set some valid auth methods. We disable the auth methods that # we're not using if we don't have the right auth info. - auth_methods = ["none", "hostbased", "keyboard-interactive"] + auth_methods = ["none", "hostbased"] auth_methods << "publickey" if ssh_info[:private_key_path] auth_methods << "password" if ssh_info[:password] @@ -461,10 +461,6 @@ module VagrantPlugins connect_opts[:keepalive_interval] = 5 end - if ssh_info[:password] - connect_opts[:non_interactive] = true - end - @logger.info("Attempting to connect to SSH...") @logger.info(" - Host: #{ssh_info[:host]}") @logger.info(" - Port: #{ssh_info[:port]}") diff --git a/test/unit/plugins/communicators/ssh/communicator_test.rb b/test/unit/plugins/communicators/ssh/communicator_test.rb index 90694923d..314bceb66 100644 --- a/test/unit/plugins/communicators/ssh/communicator_test.rb +++ b/test/unit/plugins/communicators/ssh/communicator_test.rb @@ -664,7 +664,7 @@ describe VagrantPlugins::CommunicatorSSH::Communicator do it "includes `none` and `hostbased` auth methods" do expect(Net::SSH).to receive(:start).with( nil, nil, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive"] + auth_methods: ["none", "hostbased"] ) ).and_return(true) communicator.send(:connect) @@ -780,7 +780,7 @@ describe VagrantPlugins::CommunicatorSSH::Communicator do it "includes `publickey` auth method" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "publickey"] + auth_methods: ["none", "hostbased", "publickey"] ) ).and_return(true) communicator.send(:connect) @@ -809,7 +809,7 @@ describe VagrantPlugins::CommunicatorSSH::Communicator do it "has password defined" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - password: 'vagrant', non_interactive: true + password: 'vagrant' ) ).and_return(true) communicator.send(:connect) @@ -818,7 +818,7 @@ describe VagrantPlugins::CommunicatorSSH::Communicator do it "includes `password` auth method" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "password"] + auth_methods: ["none", "hostbased", "password"] ) ).and_return(true) communicator.send(:connect) @@ -860,7 +860,7 @@ describe VagrantPlugins::CommunicatorSSH::Communicator do it "includes `publickey` and `password` auth methods" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "publickey", "password"] + auth_methods: ["none", "hostbased", "publickey", "password"] ) ).and_return(true) communicator.send(:connect) diff --git a/test/unit/plugins/communicators/winssh/communicator_test.rb b/test/unit/plugins/communicators/winssh/communicator_test.rb index e71e474df..b0c189f4a 100644 --- a/test/unit/plugins/communicators/winssh/communicator_test.rb +++ b/test/unit/plugins/communicators/winssh/communicator_test.rb @@ -328,7 +328,7 @@ describe VagrantPlugins::CommunicatorWinSSH::Communicator do it "includes `none` and `hostbased` auth methods" do expect(Net::SSH).to receive(:start).with( nil, nil, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive"] + auth_methods: ["none", "hostbased"] ) ).and_return(connection) communicator.send(:connect) @@ -420,7 +420,7 @@ describe VagrantPlugins::CommunicatorWinSSH::Communicator do it "includes `publickey` auth method" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "publickey"] + auth_methods: ["none", "hostbased", "publickey"] ) ).and_return(connection) communicator.send(:connect) @@ -458,7 +458,7 @@ describe VagrantPlugins::CommunicatorWinSSH::Communicator do it "includes `password` auth method" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "password"] + auth_methods: ["none", "hostbased", "password"] ) ).and_return(connection) communicator.send(:connect) @@ -500,7 +500,7 @@ describe VagrantPlugins::CommunicatorWinSSH::Communicator do it "includes `publickey` and `password` auth methods" do expect(Net::SSH).to receive(:start).with( anything, anything, hash_including( - auth_methods: ["none", "hostbased", "keyboard-interactive", "publickey", "password"] + auth_methods: ["none", "hostbased", "publickey", "password"] ) ).and_return(connection) communicator.send(:connect)