diff --git a/cf_remote/Vagrantfile b/cf_remote/Vagrantfile index 569c062..8a88cde 100644 --- a/cf_remote/Vagrantfile +++ b/cf_remote/Vagrantfile @@ -26,7 +26,11 @@ Vagrant.configure("2") do |config| node.vm.box = VM_BOX node.vm.provision "shell" do |s| - ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip + ssh_pub_key_path = "#{Dir.home}/.ssh/id_rsa.pub" + if !File.file?(ssh_pub_key_path) + abort "SSH key not found at #{ssh_pub_key_path}. Please create one with: ssh-keygen -t rsa -b 4096" + end + ssh_pub_key = File.readlines(ssh_pub_key_path).first.strip s.inline = <<-SHELL echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys echo #{ssh_pub_key} >> /root/.ssh/authorized_keys