Connecting to the cluster¶
To connect to the cluster, you need to use a terminal application. These are available on Linux and MacOS but may require configuration or installation on Windows. See the relevant section of the ScienceCloud Training Handout for more detail.
Connecting with a password¶
Please note that you need to be on the UZH network or connected to UZH VPN in order to log in with a password. To be able to log in without UZH VPN, you would need to configure the passwordless authentication.
You can connect to the cluster using your UZH shortname and Active Directory (AD) password, like so
After running the command you will be prompted for your password. In most cases, your AD account password will be the same as your Email/Collaboration password. If you are unable to log in using your Email/Collaboration password, you would need to update your AD password in the Identity Manager. Please note that there will be no echo as you type your password; i.e., nothing will be displayed when you type each character.
First, create an SSH key on your local laptop/computer using
ssh-keygen -t rsa -b 4096
If you use the default names offered by the
ssh-keygen command, your private key and public key will be called
id_rsa.pub respectively. Make sure to run the commands below using whatever name values you've chosen for your keys (i.e., update the commands accordingly).
Then, once you have located the public key that you just created (if you use the default name, it will be called
id_rsa.pub located in the
~/.ssh folder), you will need to add this key to the
authorized_keys file on ScienceCluster. You have 2 options when doing so:
Option 1: Use ssh-copy-id from your client¶
You can use
ssh-copy-id to add the public key.
From Mac, Linux, or WSL on Windows:
ssh-copy-id -i ~/path/to/local/your_public_key_name.pub firstname.lastname@example.org
This will add the public ssh key to ScienceCluster, stored as a new line in the file
Option 2: Use a terminal-based text editor from the server¶
Using a terminal-based text editor to edit the
authorized_keys file is also an option if you prefer a more manual approach.
First, it is suggested to make a backup of the existing
authorized_keys file (if there is one), in case you make any errors during this process.
cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys_copy
If there is no current
authorized_keys file on ScienceCluster, you can create a new file with the the
nano text editor:
This command will open the Nano text editor and allow you to edit the new
authorized_keys file. It is important to note: each line of the
authorized_keys file is a public ssh key.
To add a new public ssh key, simply move the cursor to a new line and paste the desired public ssh key. When you are finished, exit the
nano editor with
CTRL+x. To confirm type
For reference, you can print the value of your public key if you run
cat ~/.ssh/your_public_key_name.pub from the laptop/computer where you generated the key pair. The entire printed value will be what you copy/paste into the
~/.ssh/authorized_keys file on ScienceCluster.
Verify a new public ssh key¶
Once you have added the public ssh key to the
authorized_keys file, you should be able to access ScienceCluster using:
ssh -i ~/.ssh/your_private_key email@example.com
I set up my ssh key pair but I still can't log in¶
A common issue with the key authentication is incorrect permissions on the home directory,
.ssh directory, or the
.ssh/authorized_keys file on the server. The home directory should be writeable only by the owner while the other two should be accessible only by the owner. You can set the correct permissions by connecting via ssh to the server and running the following commands:
chmod 750 $HOME chmod 700 $HOME/.ssh chmod 600 $HOME/.ssh/authorized_keys
If you aren't prompted for your password, try this command:
ssh -o PubkeyAuthentication=no -o PreferredAuthentications=password firstname.lastname@example.org
I get an error message saying "Remote host identification has changed"¶
Run the following command, which will update your file
ssh-keygen -R cluster.s3it.uzh.ch
-vvv to your ssh command, which prints a verbose output. For example,
ssh -vvv email@example.com
and send our helpdesk the output as text or a screenshot.