From d1fdee7ae3769c2792fa366531c59aeb677a7dbf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 3 Jan 2014 10:45:42 -0800 Subject: [PATCH] core: warn if password only on `vagrant ssh` --- lib/vagrant/action/builtin/ssh_exec.rb | 4 ++++ templates/locales/en.yml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/lib/vagrant/action/builtin/ssh_exec.rb b/lib/vagrant/action/builtin/ssh_exec.rb index 0268f3c29..4e644e38d 100644 --- a/lib/vagrant/action/builtin/ssh_exec.rb +++ b/lib/vagrant/action/builtin/ssh_exec.rb @@ -35,6 +35,10 @@ module Vagrant end end + if info[:private_key_path].empty? && info[:password] + env[:ui].warn(I18n.t("vagrant.ssh_exec_password")) + end + # Exec! SSH.exec(info, env[:ssh_opts]) end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 545a50291..55d99a88c 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -77,6 +77,11 @@ en: %{names} provisioner_cleanup: |- Running cleanup tasks for '%{name}' provisioner... + ssh_exec_password: |- + The machine you're attempting to SSH into is configured to use + password-based authentication. Vagrant can't script entering the + password for you. If you're prompted for a password, please enter + the same password you have configured in the Vagrantfile. cfengine_config: classes_array: |-