Connecting to the RHPC cluster#

Get access and login to the servers#

You can get access to the system by sending an e-mail to the RHPC admins (rhpc-admin@nki.nl) after asking permission to Jonas Teuwen (send with Jonas in CC). They will then create an account for you on the server, set up a password and help you set up an authenticator app. You will need these to login to the server without an ssh connection.

Here are the commands to login to the server:

https://wiki.rhpc.nki.nl/wiki/index.php/Login_to_RHPC

If you do this, you will be prompted to provide several passwords. First, it’s the two factors for rhpc.nki.nl as described above. Then, the password is the concatenation of your set password and the 2FA code. So if your password is F00!b4r? and your 2fa code is 123 123, the password here would be F00!b4r?123123.

To connect to the servers with VPN#

To connect to the server with VPN you can follow the following steps: 1. Ask the rhpc-admin for a VPN certificate (rhpc-admin@nki.nl). You will receive a .conf file. 2. Download wireguard[https://www.wireguard.com/install/] and install it on your PC. 3. Click on ‘Import tunnel from file’ and add the .conf file 4. Activate the VPN 5. You can now access the server by using the address <servername>.rhpc.nki.nl

To connect to the servers with ssh#

If you are a windows user, install windows subsystem for linux (wsl) or ubuntu. If you are planning to use Pycharm remote deployment (very likely), then also set up the connection through Windows Powershell as explained below. Do not use the MobaXterm option, as this is more difficult to set up and offers less benefits like the direct ssh connection or connecting to the servers through Pycharm.

For this you need to create a shh key pair.

Ubuntu/WSL: Connect to rhpc#

  1. Open shell

  2. Generate ssh key pair with: ssh-keygen -t rsa -b 4096 -C "USERNAME@rhpc.nki.nl"

    1. First prompt: Press enter to accept the default file location in which the public (id_rsa.pub) and private (id_rsa) key pair should be saved.

    2. Second prompt: Enter a passphrase to encrypt your private key!

  3. Type ssh-add

  4. Go to the .ssh folder cd ~/.ssh

  5. Type cat id_rsa.pub → Prints the public key to the shell, so you can easily copy it Ctrl+C

  6. Send the public key to the rhpc-admins so they can add it: rhpc-admin@nki.nl

You should now be able to connect to the rhpc server via ssh without a password after the rhpc admins add your ssh key to the cluster. Test this with command: ssh rhpc

Ubuntu/WSL/MacOS: To jump between rhpc servers#

  1. Create an ssh config file in ~/.ssh/config, with the following information:

ControlMaster auto
ControlPath <your home folder on local machine>/.ssh/tmp/%h_%p_%r

Host rhpc
  User <enter your RHPC username>
  HostName rhpc.nki.nl
  ServerAliveInterval 60
  ForwardAgent yes
  Compression yes
  ForwardX11 yes

Host rhpc-kosmos
  Hostname kosmos
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-gaia
  Hostname gaia
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-euctemon
  Hostname euctemon
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-galileo
  Hostname galileo
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-herakles
  Hostname herakles
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-plato
  Hostname plato
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-schrodinger
  Hostname schrodinger
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-ptolemaeus
  Hostname ptolemaeus
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-aristarchus
  Hostname aristarchus
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-eudoxus
  Hostname eudoxus
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-alanturing
  Hostname alanturing
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-roentgen
  Hostname roentgen
  User <enter your RHPC username>
  ProxyJump rhpc

Host rhpc-hamilton
  Hostname hamilton
  User <enter your RHPC username>
  ProxyJump rhpc
  1. chmod 600 config

  2. Create a ~/.ssh/tmp folder and give proper permissions (chmod 700).

  3. Also give proper permissions to your RSA key with chmod 600 ~/.ssh/id_rsa and chmod 600 ~/.ssh/id_rsa.pub.

You will then be able to directly jump over the rhpc.nki.nl host by logging in for instance with ssh rhpc-ptolemaeus. Also PyCharm remote deployment should work.

Connect to rhpc with Windows Powershell (necessary for PyCharm Remote Deployment):#

  1. Make sure OpenSSH Client is in Apps & Features. If not, install it.

  2. Run as administrator the Windows command prompt or Windows Powershell. Do not use Ubuntu or WSL. Windows cmd and WSL need to make separate ssh connections to the server. Pycharm remote deployment on Windows is only possible through the ssh connection made by the Windows cmd to the remote server.

  3. Ideally, make sure that the folder C:Users\ *username*/.ssh/ is empty to avoid any conflicts. (rm * )

  4. Type ssh-keygen or ssh-keygen -t rsa -b 4096 -C "USERNAME@rhpc.nki.nl"

  5. Press enter to save your ssh private and public ssh keys in folder C:Users\ *username*/.ssh/.

  6. You’ll be asked to enter a passphrase. Hit Enter to skip this step.

  7. The system will generate the key pair, and display the  key fingerprint and a randomart image.

  8. On your local windows machine, open WSL and navigate to /mnt/c/Users/username/.ssh (Not !! ~/.ssh as this is a different directory in WSL).

  9. You should see two files. The identification is saved in the

    id_rsa file and the public key is labeled id_rsa.pub. This is your SSH key pair.

  10. To add the private ssh-key to the ssh agent in Windows Powershell:

    1. By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.

      # Make sure you’re running as an Administrator.

      Get-Service ssh-agent | Set-Service -StartupType Manual

      # Start the service

      Start-Service ssh-agent

      # This should return a status of Running

      Get-Service ssh-agent

      # Now load your key files into ssh-agent

      ssh-add C:\Users\username\.ssh\id_rsa (private key)

  11. Print your public ssh key that you generated for the connection to the server with cat id_rsa.pub. Then copy the key.

  12. Send the public key to the rhpc-admins so they can add it: rhpc-admin@nki.nl

You should now be able to connect to the rhpc server via ssh without a password after the rhpc admins add your ssh key to the cluster. Test this with command: ssh rhpc

Windows Powershell: To jump between rhpc servers#

  1. Create a config file that contains:

    Host rhpc
      User <username>
      HostName rhpc.nki.nl
      ServerAliveInterval 60
      ForwardAgent yes
      Compression yes
      ForwardX11 yes
    
    Host rhpc-kosmos
      User <username>
      HostName kosmos
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-aristarchus
      User <username>
      HostName aristarchus
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-ptolemaeus
      User <username>
      HostName ptolemaeus
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-eudoxus
      Hostname eudoxus
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-euctemon
      Hostname euctemon
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-galileo
      Hostname galileo
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-herakles
      Hostname herakles
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-gaia
      Hostname gaia
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-alanturing
      Hostname alanturing
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-roentgen
      Hostname roentgen
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-schrodinger
      Hostname schrodinger
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-hamilton
      Hostname hamilton
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    
    Host rhpc-plato
      Hostname plato
      User <enter your RHPC username>
      ProxyCommand ssh -W %h:%p rhpc
    

    Save as config (no extension) in the C:/Users/your_username/.ssh directory.

  2. You will now be able to directly jump over the rhpc.nki.nl host by logging in for instance with ssh rhpc-ptolemaeus.Also PyCharm remote deployment should work.