How to set up a password less access to mésocentre by SSH
The procedure of setting up the SSH keys and SSH client is different on different systems.
GNU/Linux
The OpenSSH utilities are already installed at the majority of GNU/Linux distributions and you only have to generate the key pair:
$ ssh-keygen -t rsa
After answering the questions concerning new key creation you can copy the resulting key to login node by using command:
$ ssh-copy-id login_name@login.mesocentre.univ-amu.fr
Please note that you can protect your key by password but this step is completely optional.
After the ssh-copy-id command has finished successfully you can login to the mésocentre cluster without using the password provided to you upon the registration.
Mac OSX
The Mac OSX is coming with the pre-installed OpenSSH utilities and all you have to do is to create the private/public key pair:
$ ssh-keygen -t rsa
After answering the questions concerning new key creation you can copy the resulting key to login node by using command:
In case if ssh-copy-id is available please do:
$ ssh-copy-id identifiant@login.mesocentre.univ-amu.fr
If ssh-copy-id is not available:
$ cat ~/.ssh/id_rsa.pub | ssh login_name@login.mesocentre.univ-amu.fr “mkdir ~/.ssh ; chmod 700 .ssh ; cat – >> ~/.ssh/authorized_keys ; chmod 600 ~/.ssh/authorized_keys
If ssh-copy-id is not available and you have copied some SSH keys already there:
$ cat ~/.ssh/id_rsa.pub | ssh cciam@login.mesocentre.univ-amu.fr “cat – >> ~/.ssh/authorized_keys
If this step is done you can login to the mésocentre cluster without using the password provided to you upon the registration.
Microsoft Windows
Under Windows you have to create the keys pair directly on the login machines. To begin with you have to connect to login server and then please type:
$ ssh-keygen -t rsa
Answer to the question in order to generate the keys (you can also add a password for the keys protection but this step is optional) and add the resulting keys to authorized keys using this command:
$ cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
Afterwards you have to copy your private key id_rsa , located at the .ssh directory of your home directory at login machines to your local computer. You can use an FTP client for that. For instance FileZilla.
Next, please download and install an utility called PuTTYgen (puttygen.exe). It’s always a good habit to download the software directly from the original websites. Open the file id_rsa, enter the password, if you have set one during key generation, and save the key (Save private key).
Finally, run your ssh client (putty for example) providing your private key (in case of PuttyConnection -> SSH -> Auth)
Now, you can access the login nodes without typing your password.
SSH access to the computing nodes:
When using slurm in interactive mode, you may need to connect to another computing nodes via SSH.
You can simplify this operation by generating yet another ssh key on login nodes and to add it to the your authorized_keys file.
After you have connected to the login node, please, type the command to create the SSH keys:
[identifiant@login01 ~]$ ssh-keygen -t rsa
If you haven’t changed the default directory during creation of key pair process then copy the keys using this command:
[identifiant@login01 ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
Otherwise you have to add the content of the file id_rsa.pub to ~/.ssh/authorized_keys