hello

2 things

1. you can set the port to something known

on one VM

config.vm.network :forwarded_port, guest: 22, host: 2291, id: "ssh"


on the second VM

config.vm.network :forwarded_port, guest: 22, host: 2292, id: "ssh"


and test


2. disable the insert ssh_key so you can connect with the insecure key



config.ssh.insert_key
<https://www.vagrantup.com/docs/vagrantfile/ssh_settings.html#config-ssh-insert_key>
=
false


then try to login with the insecure ssh key

https://github.com/hashicorp/vagrant/blob/master/keys/vagrant



Alvaro





On Fri, Oct 18, 2019 at 8:45 PM steve gibson <[email protected]> wrote:

> Hi,
>
> I'm am looking for a way to get the host port for the SSH port-forward and
> be able to write it in a file on the guest.
>
> My scenario is this:
> I have a multi-machine setup with 2 VMs (using vbox). Both machines need
> to be able to scp to each other. Since eth0 is on a private network, I
> cannot access one guest from the other. And because of the nature of my
> project, I cannot add a second network interface.
> So I am looking for a way to create a /root/.ssh/config file on each guest
> and define the peer guest with the port that is made available on the host.
> The IP would be the GW of the guest
>
> So how can I get VM1's ssh port when I am provisioning VM2 ?
>
> Thank you.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/077d5476-dff0-4db8-9d5e-029b9ef4a0d6%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/077d5476-dff0-4db8-9d5e-029b9ef4a0d6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ey91tXZP7DP755Otkx_aNM_%3DNJnbPCex7wd6KPEhYC2rQ%40mail.gmail.com.

Reply via email to