I'm trying to set up two VMs with Vagrant, and one of them needs to be able to ssh into the second one using the private key.
I defined both VMs inside one vagrantfile, started them up and then copied the private key from the .vagrant directory into my first VM. I was then able to ssh into the second VM without a password.
The problem is that this is not stable, Vagrant recycles this key each time I do vagrant up
and creates a new one. This obviously breaks the ability to ssh from the first VM to the second one until I copy the private key again.
I don't particularly care which key exactly Vagrant uses, I just want it to be stable so that I can always ssh between my VMs. How can I do that?