I am trying to PSSH to multiple hosts, but instead of going to the home directory, i would like to go directly into a particular directory. Can anyone help me with how to do this? I have searched quite a lot for this, but without much luck.
At the moment my code looks like this:
pssh -h hosts.txt -P -i -v -l root -o . -I < downloadpkgs.sh
I found out how to do it.
pssh -h hosts.txt -P -i -v -l root -o . -x "cd /tmp; bash" -I < downloadpkgs.sh
In this way I login directly into the /tmp directory on all the remote machines.
Notice that it is important to specify
bash after the
Explanation: using the -x option of pssh. For more information about this flag read the manpage.