1

Here's what I do with PuTTY:

PuTTY settings, Connection > SSH > Tunnels:
source = 8000
destination = 0.0.0.0:8000

And then after I ssh into ServerA (a unix jump server in this instance), I use the following command to log into ServerB:

$ ssh serverB -L 8000:0.0.0.0:8000

Then I run the source command for the Django virtual environment, then the following runserver command:

$ python manage.py runserver 0.0.0.0:8000

And then I am able to access the website on my local machine via http://127.0.0.1:8000.

How do I set up this kind of thing in MobaXterm? I can't figure it out; its Tunneling options are much more confusing, and everything I try fails to work.

2
  • Is 0.0.0.0 used as an example here, or is it the literal address that you've used in PuTTY's configuration? Commented Oct 14, 2019 at 14:51
  • That is the literal address. My PuTTY setup works perfectly fine. I'm just wondering how it is done in MobaXterm. The only examples are ServerA and ServerB.
    – Ness
    Commented Oct 14, 2019 at 17:42

1 Answer 1

2

For MobaXterm, open the MobaSSHtunnel and select "Local port forwarding"

Enter the following information:

Forwarded port - the port on your browser that you will use to access the Django site on your local machine (example: 1234 so that you can access the website on localhost:1234)

SSH server - the IP address of your remote server

SSH login - your username on the remote server

SSH port - the port on the SSH server that you use (usually 22).

Remote server - the address of the Django site on the remote server (127.0.0.1 on your case)

Remote port - the port of the Django site on the remote server (8000 on your case)

In this example, I access the Django site on localhost:1234 on my browser: in the image in this example, I access the Django site on localhost:1234 on my browser

If you use an SSH key for logging in, you can add a key after you have saved the tunnel.

To add SSH key, press the key on the "Settings": to add SSH key, press the key on the "settings"

Afterward, you can open the Django app on your own browser at localhost:1234! :)

1
  • or for simplicity, you can use this command on you mobaxterm when running the manage.py instead: "$python manage.py runserver 0.0.0.0:8000" then you can access it on the ip of your remote server, at port 8000. No need for port forwarding
    – engrfats
    Commented Jul 23, 2020 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .