7.0 Creating SSH Shared Keys for Cluster Users

So that you do not have to manually copy the files created by the job, set up SSH shared keys for all your regular users on all of the compute nodes. To create a public and private key, do the following:

  1. Run the following on the Linux head node:
  2. > ssh-keygen -t rsa
  3. Accept default settings and do not submit a passphrase (press Enter three times).
  4. From the head node, SSH onto each and every node in the cluster by hostname (including the head node) to append the host's public key to the .ssh/known_hosts file.
  5. > for i in node01 node02 node03; do ssh -o StrictHostKeyChecking=no ${i} hostname; done
  6. Append the contents of id_rsa.pub to the authorized_keys file.
  7. > cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  8. Create the .ssh directory on all compute nodes in case it does not exist.
    > for i in node04 node05 node06; do ssh ${i} mkdir .ssh; done
    
  9. Copy the .ssh folder to the nodes.
  10. > for i in node01 node02 node03; do scp -r .ssh/id_rsa.pub ${i}:~/.ssh; done
    
  11. (Optional step) To allow users to access the compute nodes from the head node, copy the authorized keys to the nodes.
  12. > for i in node01 node02 node03; do scp -r .ssh/authorized_keys ${i}:~/.ssh; done
NoteFor information about automating SSH key creation, see the Automating the Home Directory and SSH Key Creation documentation.

Copyright © 2011 Adaptive Computing Enterprises, Inc.®