None of the older posts worked for me, although some came close. I had to make rsa keys with keygen in the terminal and go with user keys. In other words, defeated by using Vagrant keys.
I am on Mac OS Mojave at the date of this post. I installed two Vagrant boxes in one Vagrantfile. I show the entire first window so that beginners can see the context. I put the .ssh folder in the same folder as the Vagrant file, otherwise use the user9091383 setting.
Credit for this decision goes to this encoder.
Vagrant.configure("2") do |config| config.vm.define "pfbox", primary: true do |pfbox| pfbox.vm.box = "ubuntu/xenial64" pfbox.vm.network "forwarded_port", host: 8084, guest: 80 pfbox.vm.network "forwarded_port", host: 8080, guest: 8080 pfbox.vm.network "forwarded_port", host: 8079, guest: 8079 pfbox.vm.network "forwarded_port", host: 3000, guest: 3000 pfbox.vm.provision :shell, path: ".provision/bootstrap.sh" pfbox.vm.synced_folder "ubuntu", "/home/vagrant" pfbox.vm.provision "file", source: "~/.gitconfig", destination: "~/.gitconfig" pfbox.vm.network "private_network", type: "dhcp" pfbox.vm.network "public_network" pfbox.ssh.insert_key = false ssh_key_path = ".ssh/" # This may not be necessary. I may remove. pfbox.vm.provision "shell", inline: "mkdir -p /home/vagrant/.ssh" pfbox.ssh.private_key_path = ["~/.vagrant.d/insecure_private_key", ".ssh/id_rsa"] pfbox.vm.provision "file", source: ".ssh/id_rsa.pub", destination: ".ssh/authorized_keys" pfbox.vm.box_check_update = "true" pfbox.vm.hostname = "pfbox" # VirtualBox config.vm.provider "virtualbox" do |vb| # vb.gui = true vb.name = "pfbox" # friendly name for Oracle VM VirtualBox Manager vb.memory = 2048 # memory in megabytes 2.0 GB vb.cpus = 1 # cpu cores, can't be more than the host actually has. end end config.vm.define "dbbox" do |dbbox| ...
Preston Jan 24 '19 at 18:50 2019-01-24 18:50
source share