Can you create SSH port forwarding tunnels or sftp/scp using the vagrant share plugin?

8 views
Skip to first unread message

Eric B

unread,
Sep 25, 2018, 11:36:12 AM9/25/18
to Vagrant
I've just used the vagrant share plugin to setup an ssh tunnel to a remote vagrant machine.  This works great for shell access.  But I have a few questions:

Once I have an ssh tunnel up to the remote machine,can I create a port forwarding tunnel to it?  For example - something like:
   ssh 8080:localhost:8080 <shared vagrant ip> ?

What about SCP or SFTP?

Finally, is there a way to open another ssh shell without needing to relaunch the entire vagrant connect process (new vm/etc)?  How can I run new SSH connections thru the existing vm that vagrant connect setup for me?

Thanks,

Eric


Alvaro Miranda Aguilera

unread,
Sep 25, 2018, 2:44:53 PM9/25/18
to vagra...@googlegroups.com
hello

what you need to do?

because if you have ssh, some protocols like scp and sftp will work over the same port, no need to use additional ports.


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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/28f9c404-8cd0-46b2-804a-08901cdcd21c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Eric B

unread,
Sep 26, 2018, 8:26:05 AM9/26/18
to vagra...@googlegroups.com
I would think so too, but the connection didn't seem to allow for it.  When I try to connect to the ssh pretty exposed on my local VM (2222), I don't even have a username, password or private key used to authenticate.  

Every SCP/SFTP/ssh connection sets up a new connection, but I have no idea how to authenticate and open a tunnel directly to the remote vagrant machine without going through the temp VM (jump server) that vagrant spins up on my end.

Thanks

Eric


Alvaro Miranda Aguilera

unread,
Sep 28, 2018, 4:09:16 AM9/28/18
to vagra...@googlegroups.com
Hello

one the VM is created, you can think of it as any other linux machine.

you can set the password you want, and create any user  you need.
you can add any public key you want to be able to use to login.

Alvaro.


For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages