Configuring SSH

OpenSSH, sftp, rsync, VSCode, …

The OpenSSH configuration file is a plain text file that defines Hosts with short, easy to type names and corresponding full DNS names (or IPs) and advanced configuration options, which private key to use, etc. This file being picked up and read by multiple SSH clients or other applications that use the SSH protocol to connect to the cluster. Most clients let you override the defaults in this file for any given login.

Config file location

It is usually located in your home directory or user profile directory under .ssh/config, i.e.

OpenSSH config location
~/.ssh/config
/home/$USERNAME/.ssh/config
~/.ssh/config
/User/$USERNAME/.ssh/config
%USERPROFILE%\.ssh\config
C:\Users\your_username\.ssh\config

OpenSSH config file format

After general options that apply to all SSH connections, you can define a line Host my_shorthand, followed by options that will apply to this host only, until another Host xyz line is encountered. See the OpenSSH documentation for a full list of available options.

Simple configuration examples

Here are different blocks of configuration options you can copy-paste into your config file. You can mix-and-match these, choose the ones you need. Just make sure to replace User xyz with your respective username and if necessary, the path/filename of your private key.

SCC

Host jumphost
	Hostname glogin.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519

Host SCC
	Hostname login-mdc.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost

Host SCC-transfer
	Hostname transfer-scc.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost
Note

You can leave out the jumphost block and ProxyJump jumphost if you always connect from within GÖNET or use VPN.

NHR / HLRN

Host Emmy
	Hostname glogin.hpc.gwdg.de
	User nimjdoe
	IdentityFile ~/.ssh/id_ed25519

Host Emmy-p2
	Hostname glogin-p2.hpc.gwdg.de
	User nimjdoe
	IdentityFile ~/.ssh/id_ed25519

Host Emmy-p3
	Hostname glogin-p3.hpc.gwdg.de
	User nimjdoe
	IdentityFile ~/.ssh/id_ed25519

Host Grete
	Hostname glogin-gpu.hpc.gwdg.de
	User nimjdoe
	IdentityFile ~/.ssh/id_ed25519

KISSKI

Host KISSKI
	Hostname glogin9.hpc.gwdg.de
	User u10123
	IdentityFile ~/.ssh/id_ed25519

Advanced configuration examples

Here are more advanced example configuration for all our clusters with convenient shortcuts for advanced users. Adapt to your needs. To understand this, remember ssh parses it’s config top-down and first-come-first-serve.

That means, if for a given Host the same option appears multiple times, the first one counts and later values are ignored. But for options not defined earlier, values will apply from successive appearances. Note that if Hostname is not specified, the host value is used.

All frontend nodes, individually specified

# Use NHR login nodes as jumphosts for the SCC
Host jumphost
	Hostname glogin.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519

# SCC login nodes
Host gwdu101 gwdu102 login-mdc
	Hostname %h.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost

# SCC transfer node
Host transfer-scc transfer-mdc
	Hostname %h.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost


# NHR/HLRN and KISSKI
Host glogin*
	Hostname %h.hpc.gwdg.de
	User u12345
	IdentityFile ~/.ssh/id_ed25519


# CIDBN
Host login-dbn02
	Hostname login-dbn02.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost


# Cramer/Soeding
Host ngs01
	Hostname ngs01.hpc.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
	ProxyJump jumphost

Complex example using config file tricks

Host jumphost
	Hostname glogin.hpc.gwdg.de
Host SCC
	Hostname login-mdc.hpc.gwdg.de
Host SCC-transfer
	Hostname transfer-mdc.hpc.gwdg.de
Host SCC SCC-transfer gwdu101 gwdu102 gwdu108 jumphost
	Hostname %h.gwdg.de
	User jdoe1
	IdentityFile ~/.ssh/id_ed25519
Host SCC SCC-transfer gwdu101 gwdu102 gwdu108
	ProxyJump jumphost

Host myNHRproject1
	User u10123
Host myNHRproject2
	User u10456
Host NHR myNHRproject1 myNHRproject2
	Hostname glogin.hpc.gwdg.de
Host kisski
	Hostname glogin-gpu.hpc.gwdg.de
	User u10789
Host glogin* glogin-gpu glogin-p3 kisski NHR myNHRproject1 myNHRproject2
	Hostname %h.hpc.gwdg.de
	User nimjdoe
	IdentityFile ~/.ssh/id_ed25519