diff --git a/plugins/synced_folders/rsync/synced_folder.rb b/plugins/synced_folders/rsync/synced_folder.rb index b0bf13877..87413afa9 100644 --- a/plugins/synced_folders/rsync/synced_folder.rb +++ b/plugins/synced_folders/rsync/synced_folder.rb @@ -28,6 +28,10 @@ module VagrantPlugins def enable(machine, folders, opts) ssh_info = machine.ssh_info + if ssh_info[:private_key_path].empty? && ssh_info[:password] + machine.ui.warn(I18n.t("vagrant.rsync_ssh_password")) + end + folders.each do |id, folder_opts| rsync_single(machine, ssh_info, folder_opts) end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 39463f7b9..2a80ae186 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -83,6 +83,14 @@ en: rsync_folder: |- Rsyncing folder: %{hostpath} => %{guestpath} rsync_folder_excludes: " - Exclude: %{excludes}" + rsync_ssh_password: |- + The machine you're rsyncing folders to is configured to use + password-based authentication. Vagrant can't script rsync to automatically + enter this password, so you'll likely be prompted for a password + shortly. + + If you don't want to have to do this, please enable automatic + key insertion using `config.ssh.insert_key`. ssh_exec_password: |- The machine you're attempting to SSH into is configured to use password-based authentication. Vagrant can't script entering the diff --git a/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb b/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb index f544e5b44..0c2aba551 100644 --- a/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb +++ b/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb @@ -40,7 +40,9 @@ describe VagrantPlugins::SyncedFolderRSync::SyncedFolder do end describe "#enable" do - let(:ssh_info) { Object.new } + let(:ssh_info) {{ + private_key_path: [], + }} before do machine.stub(ssh_info: ssh_info)