You shall have a key pair configured in your account to permit a bi-directional transparent connection from one cluster to the other (you can check that in your
~/.ssh/authorized_keys and by successfully running:
(access-gaia)$> ssh chaos-cluster
(access-chaos)$> ssh gaia-cluster
If that’s the case, you can ignore the rest of this section. Otherwise, you will now have to configure a passphrase-free SSH key pair to permit a transparent connection from one cluster to another.
Connect to the
(laptop)$> ssh chaos-cluster
generate a new SSH key pair with
ssh-keygen(leave the passphrase empty):
(access-chaos)$> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/users/cparisot/.ssh/id_rsa): /home/users/cparisot/.ssh/id_rsa2 Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/users/cparisot/.ssh/id_rsa2. Your public key has been saved in /home/users/cparisot/.ssh/id_rsa2.pub. The key fingerprint is: 79:87:7f:8c:27:a9:a7:bd:d1:9f:85:d5:0b:e5:f4:be email@example.com The key's randomart image is: +--[ RSA 2048]----+ | | | | | o | | . . + o| | S o .. .+| | . o =.+.| | * *.o| | o.= .+| | ooo. E.| +-----------------+
authorize the newly generated public key to be used during challenge/response authentication:
(access-chaos)$> cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1[...]2E1R firstname.lastname@example.org (access-chaos)$> cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
you can check that it works by connecting to localhost:
``` (access-chaos)$> ssh -p 8022 localhost [...] (access-chaos)$> exit # or CTRL-D ```
add an alias to facilitate the connection to each cluster by adding the following SSH configuration entry in the file
Host gaia-cluster chaos-cluster User yourlogin Port 8022 Host gaia-cluster Hostname access-gaia.uni.lu Host chaos-cluster Hostname access-chaos.uni.lu
You’ll have to setup the same key package on the gaia cluster such that you can then work indifferently on one or another cluster. It’s also the occasion to learn how to add a new SSH key to your authorized key portfolio.
Open another terminal and connect to the gaia cluster
(laptop)$> ssh gaia-cluster
edit the file
~/.ssh/authorized_keysto add your previously generated key on chaos (use
:wqin vim to save and quit):
(access-gaia)$> vim ~/.ssh/authorized_keys
go back to the terminal where you’re connected on chaos, you shall now be able to connect to gaia, and reversely:
(access-chaos)$> ssh gaia-cluster [...] (access-gaia)$> exit # or CRTL-D
You have a different home directory on each UL HPC site, so you will usually use Rsync or scp to move data around (see transferring files tutorials).
Now that we are able to connect from chaos to gaia, we will transfer the SSH keys and configuration in place from chaos and check that we can connnect back:
(access-chaos)$> scp ~/.ssh/id_rsa* gaia:.ssh/ (access-chaos)$> scp ~/.ssh/config gaia:.ssh/ (access-chaos)$> ssh gaia-cluster [...] (access-gaia)$> ssh chaos-cluster (access-chaos)$> exit # or CRTL-D (access-gaia)$> exit # or CRTL-D
So now we have setup a bi-directional transparent connection from one cluster to the other.