Files
public-setupfiles/system_command_run/README.md
T
WickedYodaandJarvis 0c62f7495a docs: add READMEs and wiki documentation for all directories
- Add comprehensive wiki documentation under .github/wiki/ (19 articles)
- Add READMEs to directories that lacked them
- Fix merge conflict markers in existing READMEs
- Update root readme.md with improved structure

Co-authored-by: Jarvis <jarvis@wickedyoda.local>
2026-09-04 12:31:11 -05:00

1.4 KiB

system_command_run

Overview

Run commands across multiple machines via SSH using a machine list file.


Files

File Description
Run_command_on_machines.sh Bash script for SSH command execution
run_command_on_machines.py' Python script (alternate, may have bugs)
run_command_on_machines_Keys.py' SSH key-based version
machines.txt Machine list (host, user, password)

Usage

Bash Script

# Edit machines.txt with target hosts
# Format: HOST USER PASSWORD (password can be empty for key auth)
./system_command_run/Run_command_on_machines.sh

Prompt:

Enter command to execute:

Example:

sudo apt update

Configuration

machines.txt

Format: HOST USER PASSWORD

docker1 root 
docker2 root YOURPASSWORD
192.168.1.100 admin PASSWORD

Leave password empty to use SSH keys.


Security Notes

  • Never commit machines.txt with real passwords
  • Use SSH keys for better security
  • Restrict machine list to trusted hosts
  • Keys version (run_command_on_machines_Keys.py') uses key-based auth

Alternative: Python Keys Version

python3 system_command_run/run_command_on_machines_Keys.py'

Uses paramiko with key-based SSH authentication.


  • Check disk usage across machines
  • Restart services on multiple hosts
  • Run maintenance scripts remotely