Connecting to CSC supercomputers
Please see the LUMI documentation for instructions on how to connect to the LUMI supercomputer
Connecting to CSC supercomputers is done with
ssh, i.e. for Puhti with
and for Mahti with
In Linux, macOS, Windows PowerShell and MobaXterm the
ssh command can be given in the terminal. To connect with PuTTY in Windows, specify puhti.csc.fi as Host Name (using the default port 22 and SSH connection type). Clicking the Open button starts a new terminal session and asks for your CSC-username and password. You can also use some code editors like Visual Studio Code to edit and run code in Puhti/Mahti remotely.
Once the terminal connection to Puhti is open you can start using it with the Linux command line tools (bash shell). An introduction to operating on the Linux command line can be found, for example, in our Linux Basics tutorial for CSC. You can have several Puhti connections open at the same time.
By default, SSH access to Puhti is authenticated with the password of your CSC user account. You can set up also SSH keys for connecting to Puhti and Mahti.
Login nodes: important note for Puhti and Mahti
The login nodes can be used for light pre- and postprocessing, compiling applications and moving data. All other tasks are to be done in the compute nodes using the batch job system. Programs not adhering to these rules will be terminated without warning. Note that compute nodes can be used also interactively
Using graphical applications
The Puhti web interface is a good platform to use most graphical applications, such as Jupyter notebooks and RStudio, in Puhti. Additionally, you can launch a remote desktop for running various graphical user interfaces. The Puhti web interface allows you also to open a persistent shell on a compute node which will keep running even if you would close your browser or lose internet connection.
If you for some reason want to use a slower, X11 based graphical connection, your local computer must have an X server program installed and running. In Linux and macOS an X server is normally installed automatically, while for Windows it needs to be installed separately. A free X server for Windows is provided, for example, by MobaXterm or Xming.
Depending on your local
ssh version, you may also need to add option
-Y to your ssh command:
ssh -X email@example.com
PuTTY, X11 forwarding is enabled in the connection settings (Connection -> SSH -> X11: Enable X11 forwarding).
Setting up SSH keys
SSH keys provide more secure authentication, which can be enabled with a two-step process:
- Generate SSH Keys on your local PC
The SSH Keys are always generated in pairs, one public key and one private key. These keys should be generated on the computer you are using to connect to CSC supercomputers.
- Copy public key from local PC to supercomputer
Only the public key should be copied, don't copy the private key.
The private key should never be shared with anyone, not even with CSC staff. It should be also stored only in the local computer (Public key can be safely stored in cloud services).
An SSH key pair can be generated in the Linux, macOS, Windows PowerShell and MobaXterm terminal as follows. For Putty, see PuTTy SSH keys instructions below.
ssh-keygen -t rsa -b 4096
You will be prompted for a file name and location where to save the key. Accept the defaults by pressing ENTER.
Next, you will be asked for a passphrase. Please choose a secure passphrase. It should be at least 8 characters long and should contain numbers, letters and special characters. Important: Do not leave the passphrase empty.
In Linux, macOS and MobaXterm the public key can be copied with
ssh-copy-id, for example in order to copy the key to Puhti use:
You will be prompted for your CSC password (not the passphrase in the previous phase). In subsequent logins you should then provide the passphrase.
SSH key file with not-default name or location
If you want to store your key in not default location (something else than
~/.ssh/id_rsa), set the key location in
~/.ssh/config file or use
ssh-agent. If you use RStudio, Jupyter Notebooks or something else that requires piping via login-node to compute-node, add agent-forwarding and key file for compute-nodes.
Host puhti.csc.fi HostName puhti.csc.fi User <csc-username> ForwardAgent yes IdentityFile /<path_to_your_key_file>/<key_file> Host *.bullx IdentityFile /<path_to_your_key_file>/<key_file>
Manual copying of public SSH key from local PC to supercomputer
If you created the SSH key using Windows Powershell or Putty or if copying the public key failed with
ssh-copy-id, you need to manually copy the public key to the supercomputer.
With Linux, macOS, Windows PowerShell and MobaXterm use these commands to copy the public SSH key. The public key file is in the folder where you saved the private key and has
.pubextension. By default it is
.ssh/id_rsa.pubunder the HOME folder, in Windows normally
scp ~/.ssh/id_rsa.pub firstname.lastname@example.org:~/.ssh/mypubkey.pub ssh email@example.com cat ~/.ssh/mypubkey.pub >> ~/.ssh/authorized_keys rm ~/.ssh/mypubkey.pub
With Putty and PuTTygen:
- Copy the public key (
ssh-rsa ...) that displayed in PuTTygen main window, make sure to scroll down the text box to the bottom.
- In Puhti/Mahti open the file
~/.ssh/authorized_keyswith your favourite editor (e.g.
nano). Paste the public key from the clipboard to the end of the file and save it.
- If you want to copy the public key from public key file created by PuTTygen, then edit the file first so, that everything is on one row only and does not include any spaces in the key itself.
- Copy the public key (
Setting up your SSH keys in MyCSC portal
You can set up your SSH keys in MyCSC portal by following these steps
- Login to MyCSC portal with your CSC or HAKA/VIRTU credentials
- Proceed to 'My profile' section (top right)
- Scroll down to end of the page where you find the section 'SSH PUBLIC KEYS'
- Click 'Modify' and select 'Add new...' to add your SSH key
- Paste your public SSH key to the text field. Supported keys are: RSA 2048, ECDSA 521, ED25519 256
- Click 'Add' and then 'Confirm' which will trigger reauthentication to the portal
- Now you can see your SSH key stored to your profile
SSH keys with MobaXterm
At least with Windows operating system, before generating the SSH key, set permanent home directory where to store the SSH key and other settings, so that they are available after closing MobaXterm:
Settings -> Configuration -> General
SSH keys with PuTTy
If you are using
PuTTY, follow these steps to set up SSH keys and to enable SSH tunneling. For more detailed instructions on SSH keys, see our Pouta user guide.
- Generate and save public and private SSH keys with passhphrase using
PuTTygen. Optionally, if you created the keys using Powershell or
ssh-keygen, convert the private key to PuTTy's format (Load an existing private key file, Save private key).
- Copy the public key to Puhti manually.
- When starting a connection with
PuTTY, select the private key file in Connection > SSH > Auth. Save the session, so that the settings can be utilized automatically everytime you connect.
If you do not want to type the passphrase of your SSH key for every connection, use SSH Agent. On most Linux systems,
ssh-agent is automatically configured and run, and no additional actions are required to use it.
In MacOs, one should add the following content to the file
Host * UseKeychain no AddKeysToAgent yes
pageant and MobaXterm MobAgent (
Settings -> Configuration -> SSH) for similar purposes.