Skip to content

SSH access to clusters with multiple accounts#

Our main SSH access documentation describes the configuration for a single account but when working in multiple projects, users also have multiple accounts.

Separate key pairs for different hosts

Create separate SSH key pairs on each host you want to use to access the HPC systems, best with separate passphrases. Multiple hosts that share the $HOME file can be seen as a single host. See SSH for information about SSH key pairs.

SSH client-side configuration file

The client-side configuration file for SSH is .ssh/config in your home directory. On this page, we use $HOME/.ssh/config to reflect that.

Template for two accounts but more are possible. Adjust <cluster> and <account*> for your needs:

# Account 1
Host <cluster>-<account1>
  HostName <cluster>.nhr.fau.de
  ProxyJump csnhr-<account1>
  User <account1>
  IdentifyFile ~/.ssh/id_ed25519_nhr_fau_<account1>
  IdentitiesOnly yes
  PasswordAuthentication no
  PreferredAuthentications publickey
  ForwardX11 no
  ForwardX11Trusted no

Host csnhr-<account1>
  HostName csnhr.nhr.fau.de
  User <account1>
  IdentifyFile ~/.ssh/id_ed25519_nhr_fau_<account1>
  IdentitiesOnly yes
  PasswordAuthentication no
  PreferredAuthentications publickey
  ForwardX11 no
  ForwardX11Trusted no


# Account 2
Host <cluster>-<account2>
  HostName <cluster>.nhr.fau.de
  ProxyJump csnhr-<account2>
  User <account2>
  IdentifyFile ~/.ssh/id_ed25519_nhr_fau_<account2>
  IdentitiesOnly yes
  PasswordAuthentication no
  PreferredAuthentications publickey
  ForwardX11 no
  ForwardX11Trusted no

Host csnhr-<account2>
  HostName csnhr.nhr.fau.de
  User <account2>
  IdentifyFile ~/.ssh/id_ed25519_nhr_fau_<account2>
  IdentitiesOnly yes
  PasswordAuthentication no
  PreferredAuthentications publickey
  ForwardX11 no
  ForwardX11Trusted no

With this configuration, you can choose the account when connecting:

$ ssh <cluster>-<account>
and
$ scp <local file> <cluster>-<account>:<destination path>

For VS Code, new remote connection entries are required. At creation, it will offer the different <cluster>-<account*> entries for selection. For general information about VS Code remote development, see here.