Skip to content

alvarobmp/macos-bulk-shutdown-ssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🍎 Bulk Remote Shutdown — 100 macOS Endpoints via SSH

IT Automation | Remote Systems Management | macOS Administration
Replaced a 30-minute manual shutdown process with a single Bash script. Zero per-machine interaction.


📋 Overview

A university computer lab (AULA01) operated 100 macOS machines across mixed OS versions (Sonoma, Monterey, Catalina). Shutting them down manually required a technician to interact with each machine individually — 20 to 30 minutes per session.

This project replaced that process entirely using parallel SSH execution from a single control machine inside the lab.

One command. 100 machines. Under 2 minutes.


⚡ Quick Summary

Environment:  University lab — AULA01 (100 macOS endpoints)
OS versions:  Sonoma · Monterey · Catalina (mixed fleet)
Method:       Parallel SSH + sudo shutdown with 1-minute grace timer
Auth:         SSH key-based (no password prompt)
Result:       100 machines shut down simultaneously in < 2 minutes

🗂️ Repository Contents

📄 README.md                          ← This file
📄 macos-bulk-shutdown-writeup.md     ← Full technical writeup

🔧 The Script

#!/bin/bash

# AULA01 — Bulk Remote Shutdown (100 endpoints)
for i in $(seq 1 100); do
    IP="192.168.x.$i"
    ssh -o ConnectTimeout=4 ade@$IP "sudo shutdown -h +1" &
done

wait
echo "Shutdown command sent to all reachable endpoints in AULA01."
Parameter Purpose
ConnectTimeout=4 Skip unreachable machines — no blocking
shutdown -h +1 1-minute grace period before shutdown
& Parallel execution — all 100 machines simultaneously
wait Wait for all background processes to finish

🛡️ Security Considerations

This solution was designed for a controlled internal lab. The writeup includes a full analysis of the security tradeoffs made and recommended hardening steps for production environments.

👉 Read the full writeup


📖 Who should read this

Audience Why it matters
IT administrators Lightweight bulk management without commercial tools
University / school IT teams Direct applicability to lab environments
Security consultants Documents real tradeoffs between automation and security
Recruiters Real-world infrastructure automation at scale

👤 Author

Alvaro Martinez | IT Infrastructure Specialist
Google Cybersecurity · Cisco CyberOps · ~10 years experience

GitHub LinkedIn


If this was useful, consider leaving a ⭐ on the repository.

About

Automated shutdown of 100 macOS endpoints (Sonoma, Monterey, Catalina) in a university computer lab using parallel SSH execution and Bash scripting. Replaces a 30-minute manual process with a single command. Includes security analysis and hardening recommendations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors