I'm using pdsh, but can't find any documentation or examples of specify the ssh key. Usually, I do
ssh -i ~/.ssh/mykey.pem <address>. How do I change the pdsh command
pdsh -R ssh -w ^server.txt "date" so I can specify my ssh key?
The manpage suggests an environment variable:
You need to either
export the variable (to make it available
pdsh's child processes) or define the variable and run
the command in one go:
# Either: export PDSH_SSH_ARGS_APPEND="-i $HOME/.ssh/mykey.pem" pdsh -w^server.txt date # Or PDSH_SSH_ARGS_APPEND="-i $HOME/.ssh/mykey.pem" pdsh -w^server.txt date
I don't know why you gave
-R ssh; for me it perfectly works without.
See also "pdsh can't find identity file, but ssh can. why?" on stackoverflow. The poster has a different problem (quoting) but uses the same approach.