From dfaa5f1d2d6af7784bc4c866874025bd299155f7 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 9 Sep 2015 18:19:54 -0700 Subject: vagrant bugfix: upload the correct vagrant ssh key. closes #7436 --- lib/leap_cli/path.rb | 5 ++++- lib/leap_cli/remote/tasks.rb | 2 +- lib/leap_cli/util/remote_command.rb | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/leap_cli') diff --git a/lib/leap_cli/path.rb b/lib/leap_cli/path.rb index 43bb3e0..62ea013 100644 --- a/lib/leap_cli/path.rb +++ b/lib/leap_cli/path.rb @@ -99,8 +99,11 @@ module LeapCli; module Path end end - def self.vagrant_ssh_key_file + def self.vagrant_ssh_priv_key_file File.join(LEAP_CLI_BASE_DIR, 'vendor', 'vagrant_ssh_keys', 'vagrant.key') end + def self.vagrant_ssh_pub_key_file + File.join(LEAP_CLI_BASE_DIR, 'vendor', 'vagrant_ssh_keys', 'vagrant.pub') + end end; end diff --git a/lib/leap_cli/remote/tasks.rb b/lib/leap_cli/remote/tasks.rb index a2d12b8..048238d 100644 --- a/lib/leap_cli/remote/tasks.rb +++ b/lib/leap_cli/remote/tasks.rb @@ -25,7 +25,7 @@ end task :install_insecure_vagrant_key, :max_hosts => MAX_HOSTS do leap.log :installing, "insecure vagrant key" do leap.mkdirs '/root/.ssh' - upload LeapCli::Path.vagrant_ssh_key_file, '/root/.ssh/authorized_keys2', :mode => '600' + upload LeapCli::Path.vagrant_ssh_pub_key_file, '/root/.ssh/authorized_keys2', :mode => '600' end end diff --git a/lib/leap_cli/util/remote_command.rb b/lib/leap_cli/util/remote_command.rb index 10a5ca8..70cd11a 100644 --- a/lib/leap_cli/util/remote_command.rb +++ b/lib/leap_cli/util/remote_command.rb @@ -142,7 +142,7 @@ module LeapCli; module Util; module RemoteCommand def contingent_ssh_options_for_node(node) opts = {} if node.vagrant? - opts[:keys] = [vagrant_ssh_key_file] + opts[:keys] = [Path::vagrant_ssh_priv_key_file] opts[:keys_only] = true # only use the keys specified above, and ignore whatever keys the ssh-agent is aware of. opts[:paranoid] = false # we skip host checking for vagrant nodes, because fingerprint is different for everyone. if LeapCli::log_level <= 1 -- cgit v1.2.3