How to automatically start a tunnel when a session is opened in MobaXterm?
Asked Answered
Y

2

10

I use MobaXterm for remote access to servers running in the cloud. For development and admin purposes, these servers expose admin application on local network interfaces. For example, Tomcat will expose 127.0.0.1/manager.

Since I prefer not to have to expose these services to the internet, I've set up ssh tunnels in MobaXterm to connect to these web applications on a local port through local port forwarding, which is easy to set up with the application itself.

My question: How can you get MobaXterm to automatically start a tunnel when a session is opened and to stop/close them when the session is ended?

I know a client like Putty would do this by default, but I don't want to use different clients for different jobs if I don't have to and MobaXterm has other features I need that Putty doesn't.

Yecies answered 23/5, 2018 at 4:34 Comment(1)
This could be a pretty obvious feature request for Moba. I'll also need it...Sectionalism
P
2

You can setup new SSH tunnels in Tunneling section (or from the MobaXterm's Tools menu, you can start MobaSSHTunnel). This will show a graphical port forwarding tool, where you can setup a new SSH tunnels which can be configured to be started automatically at MobaXterm startup by selecting Autostart from the tunnel settings.

MobaXterm's MobaSSHTunnel, SSH tunnel, dynamic local remote port forwarding

Prejudge answered 9/8, 2018 at 11:30 Comment(3)
Thanks for the useful illustration.Marisamariscal
Thanks for the feedback, I'm aware of the built-in wizard for setting up the connection, of which you've provided a screenshot, but your suggestion for auto-starting would start the tunnel on MobaXTerm startup. I only want the tunnel to be opened when a specific session is started. This way, I can connect to services running on a specific port depending on what server I'm connected to. Your suggestion would always start and having multiple tunnels mapped to the same local port would be an issue.Yecies
This solution doesn't quite work for me, because it requires me to log in again on the SSH server (where I need to type a long password, unfortunately). With Putty and also with OpenSSH the tunnel is established together with the interactive session, requiring only one login for both.Tremayne
R
0

Try to use MyEn Tunnel: https://myentunnel.informer.com/

There is an option to Connect on Startup

enter image description here

Roryros answered 22/3, 2022 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.