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 UbuntuYou 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.
To generate an SSH key pair on Linux or MacOS, we use the inbuilt ssh-keygen. Open your terminal and:
-
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.
-
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
Enterto confirm the default or provide an alternative. -
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] -
Done!
This created two files:
~/.ssh/id_ed25519→ private key (keep this file secret!)~/.ssh/id_ed25519.pub→ public key (save to share)
-
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_ed25519This way, you don’t need to retype your passphrase multiple times within a session.
-
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/PrivateKeyCreating 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/configPaste 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/KeyConfig 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 hpcgateUploading 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.
- Browse to account.uni-mainz.de and use your
JGU credentialsfor login. - Paste the contents of your public SSH key into the
SSH public keyfield. - You can add further comments in the
Comment or key namefield to help you identify this key again at a later point in time. - Please select
HPCLOGINas thekey usage. - Feel free to leave the duplicate
HPCLOGINas is, or delete it from the public key field. - At last, please click on
Save. - The newly added SSH key should be displayed in the SSH key overview.