How to run commands on different servers with different login credentials

Wouldn’t it be lovely if you could run some command on a bunch of servers?

Of course, you can! Most of us would do something like that:

But what if there are dozens of servers with different usernames to log-in with, different SSH-keys to use and even different ports to connect to? It would be quite convenient to use some conficuration file with all these login-details:

And here goes the script:

Now you can do something like that:

If I ever update this script with some new features, you could always get the latest verion from GitHub: https://gist.github.com/melnik13/be1160a5bf73e246cd5f.

Enjoy your great power, but don’t forget about great responsibility comes with it! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.