1

I am able to connect to a remote machine using the following command:

/usr/bin/adm/pdsh -l root -w "loop"
pdsh>

but when I try to execute any command it gives following error:

pdsh> cd /var
loop: Permission denied, please try again.
loop: Permission denied, please try again.
loop: Permission denied (publickey,password).
pdsh@rushi: loop: ssh exited with exit code 255

Please, can anyone provide any solution to this? Thanks.

rushi
  • 11

1 Answers1

3

The problem is that you don't have permission to log on the remote machine. When you type the first command pdsh ..., it really doesn't connect to the server. It does when you try to execute any command, like cd /var. As pdsh is intended to execute commands in parallel, I suggest you to configure public key authentication:

  1. Do ssh-keygen -t rsa on your server. You will be prompted to select the name and location of the key and the key.pub files.
  2. Open the .pub file you generated on the previous step and copy the full text.
  3. Paste that text on the /root/.ssh/authorized_keys file on the remote server (loop). If the file does not exist you can create it safely. (Remember to set appropriate perms, like 600 ).
  4. Profit!
rsl
  • 396
  • 1
    If you have configured keys, it might also be you configured you key with a password. My version of pdsh will balk at that under normal run conditions. If so, generate a new key, leave it passwordless, copy it to the remote servers and try again. – j03m Dec 14 '12 at 01:51
  • @j03m You might want to post this as an answer as this has just hit me as well. – Adrian Frühwirth Sep 03 '13 at 06:55