Han Qi
Han Qi

Reputation: 503

Does gnu parallel's --onall not work with sshpass?

I am trying to run the same command on multiple servers. Each server is password authenticated, so I exported SSHPASS.

From option 2 on, --onall is added and commands start to fail.

  1. parallel -S 1/user:@ip echo ::: foo shows foo successfully (looks like it uses sshpass automatically? And the colon after user must be there to not hang forever, no idea why)
  2. parallel -S 1/user:@ip,1/user:@ip2 --onall echo ::: foo hangs with no response
  3. parallel --ssh "sshpass -e ssh" -S 1/user:@ip,1/user:@ip2 --onall echo ::: foo gives Permission denied, please try again. twice (This is the same error when I purposely give the wrong password in a normal ssh user@ip command, making me think using --oncall stops sending the correct, or any password)
  4. parallel --ssh "sshpass -e ssh" --slf iplist --onall echo ::: foo shows the same output as point 3. iplist is the newline separated version of the ips in option 2 and 3, i'm assuming -slf does exactly the same as -S.

Questions

  1. How do I run the same command on multiple servers considering it expects a password?
  2. Why does --onall make the terminal hang with no response? (Is there any interactive waiting going on under the hood)

Upvotes: 0

Views: 37

Answers (1)

Ole Tange
Ole Tange

Reputation: 33740

You have found a bug.

https://savannah.gnu.org/bugs/?65679

Fixed in 20240522 (with the restriction that the password cannot contain space):

https://git.savannah.gnu.org/cgit/parallel.git/diff/NEWS

Upvotes: 0

Related Questions