Created
September 17, 2015 16:43
-
-
Save senderista/d62db50e2138838ca76f to your computer and use it in GitHub Desktop.
Run commands from a local file on a list of servers over SSH
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
for s in `cat servers.txt`; do | |
echo $s | |
ssh username@$s "sudo -u nobody bash -s" < cmds.sh | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment