简体   繁体   中英

How to automatically set passphrase of SSH key for running MPI program in a cluster?

I am on a linux cluster with 4 nodes (n1.a.com, n2.a.com, n3.a.com, n4.a.com) logged in node 1 (n1.a.com) .

Now I have an executable named " sample.out " which I want to run on the cluster from node 1 .

I have SSH keys set with passphrase .

I also have the host list file in " hosts.txt " as

n1.a.com:8
n2.a.com:8
n3.a.com:8
n4.a.com:8

So, I am running the following command:

mpiexec -n 32 -f hosts.txt ./sample.out

However, running this above command, all the other 3 nodes are asking for passphrase simultaneously as

 Enter passphrase for key '/home/a/.ssh/id_dsa': Enter passphrase for key
 '/home/a/.ssh/id_dsa': Enter passphrase for key '/home/a/.ssh/id_dsa':

Now typing the passphrase here is not working ! It repeatedly asks for the same thing on entering the passphrase.

My queries

  1. Is there any way to automatically pass the passphrase to all the nodes ? (May be through a script)
  2. Or, shall I have to use passphrase-less keys?
  3. Is there any way to avoid this by using the " Torque Batch " manager which is also installed?

Some may-be useful information of my system:

Workload Manager :- Torque Batch System

>>mpich2 --version
HYDRA build details:
    Version:                                 1.4.1p1
    Release Date:                            Thu Sep  1 13:53:02 CDT 2011
    Process Manager:                         pmi
    Launchers available:                      ssh rsh fork slurm ll lsf sge manual persist
    Topology libraries available:              hwloc plpa
    Resource management kernels available:    user slurm ll lsf sge pbs
    Checkpointing libraries available:
    Demux engines available:                  poll select

In order to avoid typing in passphrase, a ssh-agent needs to be created and the passphrase be added as follows:

ssh-agent $SHELL 
ssh-add 

Source: MPICH 1 Documentation: Configuring with ssh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM