# MobaXterm

MobaXterm (opens new window) is an application that simplifies SSH connections to your lab from your local Windows machine.

Requirements

(1) A working SSH connection to both entry and home as described in the How To Connect To Your Lab guide.

(2) The Moba file with credentials and configuration will be handy to ease the installation. Contact us for a new file if you need one.

Without these it will be hard to ensure a smooth MobaXterm configuration.

# 1. How to install

TIP

Lab users from NTNU can install MobaXterm using the software center.

# 2. Configure Mobagent

2.1 Start MobaXterm and open Settings:

mobaxterm_settings

2.2 Choose SSH tab and make sure that option Use internal SSH agent "Mobagent" is checked. Then click OK to save the settings.

mobaxterm_allow_mobagent

2.3 If you are asked to confirm restart of MobaXterm click Yes to confirm.

mobaxterm_restart_settings

# 3. Generating SSH Key

In case you have not used SSH keys before and you need to generate one, on Windows you can do so in MobaXterm using Local terminal

# 3.1 Open Local terminal

Clicking on Local terminal button opens MobaXterm command line:

Main View - Local terminal

# 3.2 Generate SSH key in local terminal

If you opened local terminal, you should see similar window:

Local terminal

Check if you already have ssh keys from before by running this command:

cat "${USERPROFILE}/.ssh/id_rsa.pub"

If previous command printed error message (No such file or directory) or there was no output it means that you probably have not created your ssh key yet and you can continue with the next steps.

Before creating SSH key we make sure that your .ssh directory exists:

mkdir -p "${USERPROFILE}/.ssh"

Now we can create SSH key:

ssh-keygen -b 4096 -t rsa -f "${USERPROFILE}/.ssh/id_rsa" -q -N ""

# 3.3 Uploading new SSH key

To be able to use the key it needs to be uploaded with ssh-copy-id. You will be asked to type in your SSH password that you made during the lab installation.

ssh-copy-id -i "${USERPROFILE}/.ssh/id_rsa.pub" username@entry-IP

Remember to replace username with your username, and entry-IP with IP address of your lab that is included in your ssh-config.txt file (format: 10.42.X.Y). Example: joe-tester@10.42.X.Y.

If you get asked to save the password, refuse by clicking on No to make sure that MobaXterm will authenticate with SSH keys instead of passwords.

# 3.4 Add SSH key into Mobagent

Check the list of Mobagent SSH keys and make sure that SSH key (id_rsa file) is included. If MobaXterm included the new key automatically, you can continue to the next step:

mobaxterm_mobagent_keys

# 4. Connect

We usually ship preconfigured Moba file with credentials. If you have not opened it, you can open it now and MobaXterm will pick up your lab session.

Connect

With a little bit of luck, you should now be able to connect directly from your client computer to your home node in your lab.

Request a new Moba file

Contact us for a new Moba file with credentials and configuration if you need one.

# Troubleshooting

# Check SSH keys in session configuration

More information
  • Right click on the session that you want to edit and choose option Edit session. mobaxterm_edit-session
  • Assure SSH option under the Session settings is selected.
  • In Advanced SSH settings make sure that private key option is checked. Then select the path to SSH key file (id_rsa). Step 1
  • Under Network settings, click on Connect through SSH gateway (jump host) Step 2
  • Check Use SSH key option and select the path to SSH key file (id_rsa). Step 3
  • Confirm session settings by clicking OK.

# Agent refused operation

More information

If you see the error message saying: Agent refused operation you need to install Putty.

agent-refused-operation

Once Putty is installed, make sure that MobaXterm is closed and started Pageant. Pageant is part of Putty installation.

putty_pageant

Once Pageant is running, you can start MobaXterm.

# Configure custom SSH config

More information

This part might be needed if you plan to use SSH tunnel. It is not part of recommended workflow.

To setup ssh config to be used in local terminal of MobaXterm use:

cat <<-EOF > /home/mobaxterm/.ssh/config

Paste content of your ssh-config.txt here

EOF

# Configure custom session

More information
  • Open MobaXterm
  • Select a new session and click on the SSH image on the Session settings.
  • In Basic SSH settings, add 10.5.5.12 as Remote host and type your username into Specify username field. Under Advanced SSH settings uncheck X11-forwarding if not used. Select ssh (private) key file if you already have one. Step 1
  • Under Network settings, click on Connect through SSH gateway (jump host) Step 2
  • Add your labs IP-address to the Gateway SSH server and your user name to the User field (the 10.42.-address from the ssh-config). Select ssh (private) key file if you already have one. Click OK to confirm SSH jump host. Step 3
  • In Bookmark settings, Name your lab session. Click OK to confirm Session settings. Step 4