You are here: 24 Data Staging > How-to > Configuring the SSH Keys for the Data Staging Transfer Script

24.1 Configuring the SSH keys for the Data Staging Transfer Script

For more details on generating keys, see the ssh-keygen man page and "SSH login without password".

To configure the SSH keys for the data staging transfer script

  1. Generate a new SSH key on the Moab server (university) if one does not already exist. To do so, run each of the following steps.
    1. Run ssh-keygen to generate a public and private rsa key pair.

      davidharris@university]$ ssh-keygen
    2. Enter the name of the file where you want to store the key, or you can accept the default location.
      /home/davidharris/.ssh/id_rsa
    3. When prompted for a passphrase, leave it blank and press Enter. Repeat when prompted to retype passphrase.
  2. Install the public key on the source and destination hosts. Note that in this example the source host is student and the destination host is labs.
    1. Copy the university public key to student. Answer yes to continue connecting.

      [davidharris@university]$ ssh-copy-id -i ~/.ssh/id_rsa.pub student
    2. Copy the university public key to labs. Answer yes to continue connecting.

      [davidharris@university]$ ssh-copy-id -i ~/.ssh/id_rsa.pub labs
  3. The next two steps generate a key-pair for each node. It is acceptable to generate a single key-pair and install it on each node. It does not matter where the key-pair is generated, so long as it is compatible with the SSH client/server.

  4. Generate a key pair on the source host (student) and install the public key generated to the destination host (labs). When prompted for a passphrase, leave it blank and press Enter. Repeat when prompted to retype passphrase.

    [davidharris@student]$ ssh-keygen
    [davidharris@student]$ ssh-copy-id -i ~/.ssh/id_rsa.pub labs
  5. Generate a key pair on the destination host (labs) and install the public key generated to the source host (student). When prompted for a passphrase, leave it blank and press Enter. Repeat when prompted to retype passphrase.

    [davidharris@labs]$ ssh-keygen
    [davidharris@labs]$ ssh-copy-id -i ~/.ssh/id_rsa.pub student

  6. Ensure that each user who will run data staging jobs has read and write permissions on each source and destination server.
  7. Test the configuration. To do so:
    1. Install the modules required to run the data staging scripts. python-paramiko is required for data staging, but python-mock is only required if you intend to run the unit test.

      > yum install python-paramiko python-mock
    2. Transfer a file from the source host to the destination host to verify that the keys work for the users configured. To do so, run /opt/moab/tools/data-staging/ds_move_scp --test=<source>%<destination> if you use scp or /opt/moab/tools/data-staging/ds_move_rsync --test=<source>%<destination> script if you use rsync. <source>%<destination> is configured the same way as the --stagein and --stageout options for msub; for help configuring your source and destination, see Staging a file or directory.
      [davidharris@university]$ /opt/moab/tools/data-staging/ds_move_rsync --test=davidharris@student:/tmp/test%davidharris@labs:/tmp
    3. In the same way, transfer a file from the destination host to the source host to verify that the keys work for the users configured.

      [davidharris@university]$ /opt/moab/tools/data-staging/ds_move_rsync --test=davidharris@labs:/tmp/test%davidharris@student:/test_processed

Related Topics 

© 2016 Adaptive Computing