Secure Remote Wake on LAN and Shutdown Controller
NanoWOL is a lightweight command line and web tool for remote PC power management with RSA authentication. It is part of the Nano Product Family.
- Secure authentication with RSA 2048 signatures for shutdown commands
- Wake on LAN magic packets
- Remote shutdown with optional port blocking
- Service mode for automatic startup
- Web UI control panel
- Command line interface for scripts
- Cross platform support for Windows, Linux, and macOS
- Modular design across crypto, WOL, agent, service, and web UI modules
- Unit tests for crypto, WOL, and service functionality
Note: primarily tested on Windows. Linux and macOS should work but feedback is welcome.
Deploy the NanoWOL agent on workstations so an admin can wake or shut down machines remotely. This saves time and reduces power usage.
Wake a NAS or home server before access and shut it down after a backup job completes.
If a home PC is left running, shut it down remotely. If a file is needed, wake the machine, access it, then shut it down.
Schedule regular shutdowns and only wake systems when needed.
- Python 3.9 or later
- Dependencies: click, flask, cryptography, requests
-
Clone the repository
git clone https://github.com/goAuD/NanoWOL.git
-
Open the project folder
cd NanoWOL -
Install dependencies using pip and the requirements file
python nanowol.py keygenThis creates keys/private.pem and keys/public.pem. The private key stays on the controller, the public key goes to the target PC.
The target PC is the machine you want to wake/shutdown remotely.
python nanowol.py agent --mac AA:BB:CC:DD:EE:FF --public-key ./keys/public.pemReplace AA:BB:CC:DD:EE:FF with the target PC's MAC address.
Find it with ipconfig /all (Windows) or ip link (Linux).
The controller is where you send commands from.
Option A: Web UI (recommended)
python nanowol.py webui --target http://TARGET_IP:5000 --mac AA:BB:CC:DD:EE:FFIf you omit --password, a secure random password is generated and printed to the console.
Then open http://localhost:5050 in your browser.
Option B: CLI commands
Wake a machine:
python nanowol.py wake --mac AA:BB:CC:DD:EE:FFShutdown a machine:
python nanowol.py shutdown --target http://TARGET_IP:5000python nanowol.py install-service --mac AA:BB:CC:DD:EE:FFThis starts the agent automatically on boot (Windows) or login (Linux/macOS).
Target PC:
- IP:
192.168.0.50 - MAC:
1C:69:7A:AB:CD:EF
On target PC:
python nanowol.py agent --mac 1C:69:7A:AB:CD:EFOn controller:
python nanowol.py webui --target http://192.168.0.50:5000 --mac 1C:69:7A:AB:CD:EF --password secret123- nanowol.py CLI entry point
- crypto.py RSA key operations
- wol.py Wake on LAN logic
- agent.py Agent Flask server
- webui.py Web UI Flask server
- service.py Cross platform service installation
- templates index.html Web UI template
- test_nanowol.py Unit tests
- requirements.txt Dependencies
The agent can install itself as a user service on Linux and macOS, and as a scheduled task on Windows. User services run when the user session is active. To start at boot without login on Linux, enable user lingering with the system login manager. On macOS, starting at boot without login requires a system launch daemon, which is not covered here.
Run pytest in your Python environment against test_nanowol.py.
- RSA 2048 signatures for shutdown commands (timestamp + nonce replay protection)
- Password protected Web UI
- Optional firewall port blocking after shutdown
- Self hosted with no external services required
- Private key is stored unencrypted by default (controller side) — protect it like a password
Note: NanoWOL is designed for LAN use. For internet access, use a VPN solution.
This section explains how to run the agent reliably on Linux and macOS, including WSL usage.
-
Shutdown permissions On Linux and macOS the shutdown command requires elevated permissions. Use a sudoers rule that allows only the shutdown command without a password.
sudo visudo
youruser ALL=NOPASSWD:/sbin/shutdown -
Service behavior on Linux The Linux service is installed as a user service. It runs when your user session is active. To start at boot without login, enable user lingering for your account using the system login manager.
-
Service behavior on macOS The macOS agent runs as a launchd user agent. It starts when you log in to your user session. To run at boot without login you need a system launch daemon, which is a different setup.
-
WSL behavior WSL is not a full Linux boot environment. Service managers may behave differently and shutdown will not power off Windows. Use WSL for development or testing.
A local shutdown command works only when you are at the machine. NanoWOL is for remote power management and secure authentication, with the ability to wake a machine that is fully off.
Wake on LAN is a hardware feature that allows a powered off PC to start when it receives a special magic packet on the network. The network adapter listens for that packet while the system is off.
Requirements include WOL enabled in BIOS, wake on magic packet enabled in the network adapter, an Ethernet connection, and power to the machine.
SSH gives full shell access and requires credentials. NanoWOL limits the agent to wake and shutdown only, and uses signed commands so a password is not transmitted.
NanoWOL uses RSA 2048 signatures for shutdown commands. The private key stays on the controller. The agent accepts only requests signed by the matching key. This reduces the attack surface compared to a general remote shell.
This tool uses the Nano Design System for consistent styling across lightweight developer tools.
MIT License
