Hints, Tips, and Tricks
How can I change my default shell?
Please submit a change request to MPCDF helpdesk. Currently, bash
, tcsh
, and csh
are supported, where
bash
is the recommended choice. Other shells such as zsh
or ksh
are
installed on the systems and can be invoked manually, if desired.
How can I launch ssh-agent
in a terminal session?
Run the commands
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
once to unlock an SSH key in your terminal session. For the lifetime of that
session, you won’t be asked to type the password for that particular key
which is convenient when working with git
in combination with
remote repositories such as MPCDF GitLab.
How can I avoid having to type my password repeatedly? How can I tunnel through the gateway machines?
An SSH ControlMaster setup establishes a connection once and reuses that connection for subsequent logins from the same machine. In addition, SSH tunnels through jump hosts can be configured using the ‘ProxyJump’ keyword (for OpenSSH 7.3 and newer), older SSH versions use ‘ProxyCommand’. ControlMaster and ProxyJump/ProxyCommand can be combined as shown below.
Please note that per default only a maximum of 10 sessions is supported within a single ControlMaster instance.
The following code snippet demonstrates a ControlMaster configuration for an OpenSSH client to log into ‘gate’. In addition it sets ‘gate’ as a jump host to log into the Raven HPC system. Alternatively, ‘gate2’ can be used.
You can find your SSH client configuration on your local machine in the file
‘~/.ssh/config’. If this file doesn’t exist yet you need to create it. Add the
following lines to it and replace YOUR_USER_NAME
with your actual
MPCDF user name, and, if necessary, adapt it to other sytems to connect to (e.g.
‘viper’, analogously to ‘raven’):
# SSH configuration taken from https://docs.mpcdf.mpg.de/faq/
Host gate
Hostname gate.mpcdf.mpg.de
User MPCDF_USER_NAME
ServerAliveInterval 120
ControlMaster auto
ControlPersist 12h
ControlPath ~/.ssh/master-%C
Host raven
Hostname raven.mpcdf.mpg.de
User MPCDF_USER_NAME
ControlMaster auto
ControlPersist 12h
ControlPath ~/.ssh/master-%C
# OpenSSH >=7.3
ProxyJump gate
# OpenSSH <=7.2
#ProxyCommand ssh -W %h:%p gate
You can now connect to the Raven HPC system directly by executing the command:
ssh raven
You only have to type your password, OTP, and password again once and be
able to reuse this connection for the rest of the day with any HPC system.
Note that scp
and rsync
use ssh
under the hood and benefit in
the same way from that configuration.
This example works on Linux and Mac but not on Windows due to limitations
of its ssh
client. On Windows, the PuTTY SSH client supports a feature
similar to ControlMaster: Tick the box “Share SSH connections if
possible” before connecting.