ssh-config checks key permissions prior to output

This commit is contained in:
Mitchell Hashimoto 2011-01-28 17:52:44 -08:00
parent e02b871d1c
commit 3c13152c16
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,10 @@ module Vagrant
vm = target_vms.first vm = target_vms.first
raise Errors::VMNotCreatedError if !vm.created? raise Errors::VMNotCreatedError if !vm.created?
# We need to fix the file permissions of the key if they aren't set
# properly, otherwise if the user attempts to SSH in, it won't work!
vm.ssh.check_key_permissions(vm.env.config.ssh.private_key_path)
$stdout.puts(Util::TemplateRenderer.render("ssh_config", { $stdout.puts(Util::TemplateRenderer.render("ssh_config", {
:host_key => options[:host] || "vagrant", :host_key => options[:host] || "vagrant",
:ssh_host => vm.env.config.ssh.host, :ssh_host => vm.env.config.ssh.host,