MasterMind

Скрипт для массового удалённого исполнения команд через ssh. Скачать

1. Установка зависимостей

yum install sshpass netcat openssh-client

2. Использование

MasterMind v1.0 remote executon tool. 2022-$(date +%Y) Nikita Lindmann
Lines in () are optional, lines in [] are variants, e.g. \"choose one\".
Usage: $0 HOSTFILE(:tag1:tag2:...tagn) ['CMD' | sh file] (keys)
HOSTFILE format:username:[password | base64password | _]@ip_or_hostname(:port)(;tag1;tag2;...;tagn)
Use '_' instead of password for ket-based auth.
Keys:
 -b: Use BASE64 encoded passwords
 -q: Enable full ssh output
 -f: Upload and run script
 -t: Remote directory to upload file. Example: -t=PATH
 -s: Set logs filename. Example: -s=PATH
 --sudo: Run command with sudo
 --tasks: Split hostfile into parts and run it parallel. Example: --tasks=4
 --delete: Remove file on remote host before logout
 --nopage: Do not print limiter strings onto log and onto screen
 --noexec: Do not execute uploaded file
 --timeout: SSH Connection timeout
 -h: Help
Tags:
 You may specify positive and negative conditions for tags to filter out only needed hosts from your hostfile.
 Example:
 $0 HOSTFILE:ubuntu CMD  Runs CMD only on machines wit tag Ubuntu
 $0 HOSTFILE:-ubuntu CMD  Runs CMD only on machines without tag Ubuntu
 $0 HOSTFILE:-ol-9:docker CMD Runs CMD only on machines without tag ol-9 and with tag Docker
 More complex conditions are not supported.