Setting up ssh between two vagrant VMs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting up ssh between two vagrant VMs

Siva Sukumar Reddy
I'm running Ubuntu16.04 as host machine.
On the top of it, I have one Master Vagrant VM, one Slave Vagrant VM.
I've assigned ip addresses to them using private network Master - 192.168.1.2, Slave - 192.168.1.3
How do I setup ssh between those two VMs so that they can access one another without password.
I tried a lot to setup that and messed up everything related to ssh configuration files. But nothing worked.
Any suggestion would be greatly helpful.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a16350ea-8b9e-461c-bc2f-666c25dd5406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Setting up ssh between two vagrant VMs

Alvaro Miranda Aguilera
hello

its more a OS question rather than a Vagrant question

I did share this week a project that does ssh password less

or you can check post like this:

alvaro


On Wed, Nov 1, 2017 at 11:25 PM, Siva Sukumar Reddy <[hidden email]> wrote:
I'm running Ubuntu16.04 as host machine.
On the top of it, I have one Master Vagrant VM, one Slave Vagrant VM.
I've assigned ip addresses to them using private network Master - 192.168.1.2, Slave - 192.168.1.3
How do I setup ssh between those two VMs so that they can access one another without password.
I tried a lot to setup that and messed up everything related to ssh configuration files. But nothing worked.
Any suggestion would be greatly helpful.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a16350ea-8b9e-461c-bc2f-666c25dd5406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezQSmFUoO7B0MCVUzxd8x8T2APKpKaQE0y-BwjsnR8DOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Setting up ssh between two vagrant VMs

Joaquin Menchaca
In reply to this post by Siva Sukumar Reddy
This ultimately has to be done at the provisioning level, you would need to have access to the private key for them to automatically log into each other, and you should set up the /etc/hosts (or use a dnscache).  One method is with the default /vagrant available, you can access the keys from /vagrant/.vagrant from within each VirtualMachine.

I have some scripts online where I do this.  I did this with shell, here's an example of config_ssh() function:
  • https://github.com/darkn3rd/storm-vagrant/blob/master/scripts/lib/base.src
I also did the same thing with Ansible:
  • https://github.com/darkn3rd/minifactory/blob/master/provision/roles/common/tasks/main.yml
Feel free to use that code, just give me credit. :)

- Joaquin Menchaca

On Wednesday, November 1, 2017 at 3:25:51 PM UTC-7, Siva Sukumar Reddy wrote:
I'm running Ubuntu16.04 as host machine.
On the top of it, I have one Master Vagrant VM, one Slave Vagrant VM.
I've assigned ip addresses to them using private network Master - 192.168.1.2, Slave - 192.168.1.3
How do I setup ssh between those two VMs so that they can access one another without password.
I tried a lot to setup that and messed up everything related to ssh configuration files. But nothing worked.
Any suggestion would be greatly helpful.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/eeb3ec7e-cb63-43a4-b656-447d18880b36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.