What is MobaXterm? How to use and connect to Ubuntu Linux VPS |
1. Introduction
MobaXterm is an SSH client for Windows that allows connections to remote servers from a Windows computer.
This guide will first cover connecting to a virtual machine with an associated "Public IP" address or via an SSH Gateway, then access to a virtual machine via "Remote Desktop" by setting up an "SSH Tunnel" will be possible.
2. Requirements
In order to proceed, you will need to know the Public or Private IP Addresses of your VM or the Public IP of the SSH Gateway. Additionally, you will need to provide your SSH key to be able to connect to a VM. Please refer to How to create SSH keys?
3. Setup MobaXterm and Connect
If you don't have MobaXterm installed, visit the MobaXterm website and download the Windows installer. After installation, start the program. If you are not allowed to install Software on your computer, you can run MobaXterm as portable app.
- Start MobaXterm and click on the "Sessions" button on the top left corner:
- Next, click on "SSH" on the top left.
- There are now 2 options on how two connect to your VM, depending whether it is accessible via a "Public IP (Floating IP)" or via an SSH gateway:
- If your VM is accessible via an Public IP:
- fill in the public IP in the "Remote host" field
- specify the username
- Click on "Advanced SSH settings", check the box next to "Use private key" and select your private key from your computer.
- Click OK
- If your VM is accessible via an SSH Gateway:
- fill in the private IP in the "Remote host" field
- specify a username
- Click on "Network settings"
- Enable "Connect through SSH gateway (jump host)
- fill in the public IP in the "Gateway SSH server" field
- specify a username if it differs from the username of your VM
- Check the box next to "Use private key" and select your private key from your computer.
- Click OK
- You will now find your SSH connection listed in the left panel under "User sessions":
- Double-click on the respective entry to connect.
- Optionally you might be asked for your SSH key passphrase. If so, enter the password and click OK to continue.
- In some cases, especially when connecting via an SSH gateway, you might be asked for your SSH key passphrase again, if so, enter your password and press ENTER.
- You will now see a terminal on the right hand side as well as a file browser in the left panel:
- You are now successfully connected to your VM!
4. Connect via Remote Desktop
4.1. Setup SSH tunnel
In order to be able to use remote desktop to connect to your VM, you need to establish a SSH tunnel to your virtual machine. Therefore, the default rdesktop port 3389 needs to be forwarded via the SSH gateway (or public IP) to your local computer. To do so, please proceed as followed:
- Start MobaXterm
- Click on "Tunneling" in the Toolbar on top
- To setup a new tunnel, click "New SSH tunnel" on the bottom left:
- Select "Local port forwarding" in the top
- Type the Private IP Address of your virtual machine into the input field on the top right.
- Type "3389" into the input field on the top right (3389 is the default port for remote desktop connections.
- Type the Public IP Address of your virtual machine or the SSH gateway into the input field on the bottom right.
- Specify your username in the field below.
- Type "22" into the input field below.
- Next, you need specify the port you can use to connect to the VM. Type "9999" (or any other free port) into the field.
- If you use multiple tunnels, make sure to set different forwarded-ports (eg. 9998, 9997,...)
- Click "Save" to save your configuration.
- Next, you need to select your private key from your local computer.
- Click on the "Key" Symbol in the "Settings" section on the right side next to your virtual machine entry, and select your private key
- You can now start the tunnel by clicking on the play button next to your entry:
- The tunnel is now open and you can continue using the Windows "Remote Desktop Connection" client.
4.2. Remote Desktop Client
You will need a "Remote Desktop Client" installed to access your virtual machine's desktop. We suggest using the built in "Windows Remote Desktop Client".
- Open up the Windows Start Menu
- Type in "Remote Desktop Connection" and press "Enter"
- In the field "Computer" type "localhost:9999"
- Click "Connect"
- The remote desktop will appear in a new window.
- Insert your username and password as provided by EODC or your administrator.