Setting Up SSH

Select your operating system and follow this guide to set up an SSH connection from your local computer to MOGON.

Onboarding Progress Checklist

  • Ask your PIPI stands for Principal Investigator, typically your project lead or supervisor who manages HPC access requests. to add your JGU account to an HPC project.
  • Generate an SSH key pair on your local machine.
  • Upload your public SSH key to your JGU account.
  • Prepare your smartphone for 2FA by installing freeOTP or privacyIDEA.
  • Send an e-mail to the HPC Group from your JGU account.
  • Complete the 2FA configuration with an HPC admin.
  • Log in to MOGON via SSH.

Generating SSH Keys

If you are on a Windows system, we recommend the installation of WSLThe Windows Subsystem for Linux (WSL) lets you run a Linux environment on Windows. WSL2 (default) uses a lightweight virtual machine with a full Linux kernel.. SSH setup and debugging on Linux is much more straightforward in comparison to native SSH clients on Windows, such as PuTTY.

Once you installed WSL and opened a Linux shell, you can follow the instructions described in the Linux tab to generate an SSH Key.

Installing WSL

To install WSL, open Powershell as administratorOpen the Start menu, type powershell, right-click Windows PowerShell or Terminal, and select Run as administrator and run the following command:

wsl --install -d Ubuntu

You could also pick a smaller Distribution than Ubuntu, but in that case you must install missing packages.

If you are using a domain computer of the JGU, the instructions below will guide you through the process of installing WSL without administrator priviliges.

  1. Press the Windows -Key to open the start menu and search for Software Center. Open the app and search for “WSL enable V1000 - install”.

To generate an SSH key pair on Linux or MacOS, we use the inbuilt ssh-keygen. Open your terminal and:

  1. Run the command

    ssh-keygen -t ed25519 -C "HPCGATE,HPCLOGIN"
    • -t ed22519 → uses a modern, secure key type (recommended)
    • -C "HPCGATE,HPCLOGIN" → mandatory comment for proper key placement in our system.
  2. Choose where to save the key

    You will see a prompt like:

    Enter file in which to save the key (/home/user/.ssh/id_ed25519):

    Press Enter to confirm the default or provide an alternative.

  3. Set a passphrase of your choice

    Use a passphrase!A passphrase is a sequence of words or text, longer and more secure than a single-word password, making it memorable yet strong (e.g., ‘MogonClusterSecureAccess2025’ or ‘correctHorseBatteryStaple’)… Hint: Don’t use these examples, create one yourself. An empty one is a serious security concern. Note: Characters are maskedWhile typing your passphrase, characters are masked for security — no visible input appears, so just type normally and press Enter. while typing.

    Enter passphrase (empty for no passphrase): [Type a passphrase]
    Enter same passphrase again: [Type passphrase again]
  4. Done!

    This created two files:

    • ~/.ssh/id_ed25519 → private key (keep this file secret!)
    • ~/.ssh/id_ed25519.pub → public key (save to share)
  5. Add key to an SSH agent (optional)

    To make the ssh-agentThe ssh-agent is a background program that securely stores and manages your SSH private keys, caching passphrases to avoid re-entering them during sessions. aware of your new key run the following command:

    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_ed25519

    This way, you don’t need to retype your passphrase multiple times within a session.

  6. Copy public key (for next step)

    Print the file to screen using:

    cat ~/.ssh/id_ed25519.pub

Modifying existing SSH Keys

If your existing key lacks the HPCGATE,HPCLOGIN comment, add it with:

ssh-keygen -c -C "HPCGATE,HPCLOGIN" -f ~/Path/To/Your/PrivateKey

Creating an SSH Configuration File

To simplify remote logins we recommend to use a SSH configuration fileThe SSH configuration file (~/.ssh/config) customizes your SSH client settings, such as host aliases, usernames, key files, and proxy options, making connections simpler and more efficient.. (The lines ForwardX11 yesX11-forwarding enables graphical apps from MOGON on your local display. are optional.) For this purpose edit ~/.ssh/config (create if needed) with:

nano ~/.ssh/config

Paste the configuration content below into the text editor’s window. Adjust the fileReplace <YOUR_JGU_USERNAME> with your actual JGU username (without the < > brackets) and update ~/Path/To/Private/Key with the full path to your SSH private key file. The default would be: ~/.ssh/id_ed25519, then save with Ctrl + o (confirm the filename with Enter), and exit with Ctrl + x.

# MOGON jump host
Host hpcgate
    HostName hpcgate.zdv.uni-mainz.de
    User <YOUR_JGU_USERNAME>    
    ForwardX11 yes    
    IdentityFile ~/Path/To/Private/Key

# for access to MOGON NHR and MOGON KI:
Host mogon-nhr
    HostName mogon-nhr-01
    User <YOUR_JGU_USERNAME>
    ProxyJump hpcgate    
    ForwardX11 yes    
    IdentityFile ~/Path/To/Private/Key
Config for OpenSSH below version 7.3
# MOGON jump host
Host hpcgate
    HostName hpcgate.zdv.uni-mainz.de
    User <username>
    IdentityFile ~/Path/To/Private/Key

# for access to MOGON NHR and MOGON KI:
Host mogon
    HostName mogon-nhr-01
    User <username>
    IdentityFile ~/Path/To/Private/Key
    ProxyCommand ssh -W %h:%p hpcgate

Uploading the Public Key

Onboarding Progress Checklist

  • Ask your PIPI stands for Principal Investigator, typically your project lead or supervisor who manages HPC access requests. to add your JGU account to an HPC project.
  • Generate an SSH key pair on your local machine.
  • Upload your public SSH key to your JGU account.
  • Prepare your smartphone for 2FA by installing freeOTP or privacyIDEA.
  • Send an e-mail to the HPC Group from your JGU account.
  • Complete the 2FA configuration with an HPC admin.
  • Log in to MOGON via SSH.

To make MOGON aware of your new SSH key, we use a web tool to transfer the public key to the server. Please note that it takes some time for these changes to propagate through our systems. During working hours it should take no more than 70 minutes.

  1. Browse to account.uni-mainz.de and use your JGU credentials for login.
  2. Paste the contents of your public SSH key into the SSH public key field.
  3. You can add further comments in the Comment or key name field to help you identify this key again at a later point in time.
  4. Please select HPCLOGIN as the key usage.
  5. Feel free to leave the duplicate HPCLOGIN as is, or delete it from the public key field.
  6. At last, please click on Save.
  7. The newly added SSH key should be displayed in the SSH key overview.