Created
February 9, 2016 22:29
-
-
Save nicwolff/7c113328412765eaf83e to your computer and use it in GitHub Desktop.
Pass password and command to PSSH sudo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( echo "PASSWORD" ; echo "COMMAND" ) | pssh -t 1 -h ~/host_list -P -I "sudo -S su -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
echo "$PSWD" | pssh -h $HOST -l $USER -I "sudo -S -- sh -c '$COMMAND'"