Skip to content

Instantly share code, notes, and snippets.

@senderista
Created September 17, 2015 16:43
Show Gist options
  • Save senderista/d62db50e2138838ca76f to your computer and use it in GitHub Desktop.
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
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