SSH between guest VMs within a multi-machine Vagrant environment.

2,353 views
Skip to first unread message

Temba Mazingi

unread,
Feb 11, 2015, 4:17:49 AM2/11/15
to vagra...@googlegroups.com
Hi all,

I have successfully set up a multi-machine environment, with a Web VM, a CMS VM and a DB VM. I am now trying to set up the separate guest VMS to have password-less SSH access between each other without having to create keys for each VM and adding these keys to each VM's authorized_keys. Is it possible to set this up using Vagrant's insecure private key - the multi-machine network is only for development purposes. Thanks in advance for any assistance provided. By the way, I am using Ansible for provisioning.

Temba Mazingi


Alvaro Miranda Aguilera

unread,
Feb 11, 2015, 3:31:43 PM2/11/15
to vagra...@googlegroups.com
Hello,

Take note that the insecure pair is getting overwritten at boot time
of the VM on the current version of vagrant, so you will have to
update the Vagrantfile to stop that happening.

So basically to do what you want to do, you may need this:

1. Ensure the known insecure keys are not overwritten.

https://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html

config.ssh.insert_key = false


2. On the master node, use the private key for ssh:

https://github.com/mitchellh/vagrant/tree/master/keys

3. On the Vagrantfile add a 2nd network, so you have have a well known
ip to connect

https://docs.vagrantup.com/v2/networking/private_network.html

That should do the trick.

Alvaro.
> --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages