Troubleshooting

How to debug your SSH connection

There are – unfortunately – a number of things that can go wrong when trying to connect to a remote system. But no need to fret: Most of these issues are quickly fixed and this guide will show you how to do so.

Common Pitfalls

A lot of users that run into trouble when setting up SSH, come across one of the following problems. Although these points have been mentioned in conjunction with the SSH setup before, it doesn’t hurt to double check them before you dive deeper into debugging:

  1. Has at least an hour passed since you uploaded your public key to our website? The propagation of your key through our systems does not happen instantaneously.
  2. Does the SSH key you uploaded to your account website have the HPCGATE and HPCLOGIN attribute? You can check the uploaded key again on the JGU account website → here.
  3. Is your SSH agent running and aware of your SSH key’s location? How to check this depends on which SSH client you use and is explained in more detail below.

SSH Agents

On Linux and MacOS an SSH agent is usually running automatically once you open the terminal. You can also start the SSH agent manually using the command eval $(ssh-agent -s). Afterwards, run the command

ssh-add <path-to-private-key>

in order to introduce your SSH key to your agent. This way, you won’t have to retype your passphrase again for the rest of the session.

In case of PowerShell on Windows the equivalent command is Get-Service ssh-agent.

If you use Putty or MobaXterm, make sure Pageant is running. Search for the program and after opening it look out for its symbol on your Windows system tray. Right-click and select View keys. Use the GUI to add your SSH key.

Investigating Log Files

On Linux and MacOS you can simply increase the verbosity level of your SSH command with the flag -vv to gain more insight into your connection attempt. For example:

ssh -vv -J <username>@hpcgate.zdv.uni-mainz.de <username>@mogon

Logging for PuTTY

The Logging configuration panel allows you to save log files of your PuTTY sessions, for debugging, analysis or future reference.

  1. To access the PuTTY logging configuration panel click on Logging under the Session-section

Firewall settings

In rare cases connections might fail because of firewall settings. If you believe that to be your case, you can confirm if other SSH connections, for example to Gitlab or Github, also fail. Please look up instructions on managing the firewall for your respective operating system.

Contacting Us

If you have followed the steps outlined above and still can’t find the issue, we will gladly help you out! Please remember to attach the log file to your e-mail.

Contact the HPC Team

In case you need further assistance, don't hesitate to contact us!