A lightweight, premium Text User Interface (TUI) firewall manager written in Rust. It provides a unified, interactive dashboard to monitor and manipulate system rules for UFW, nftables, and iptables in Linux environments (Debian, Ubuntu, CentOS, RHEL).
- Unified Firewall Control: Abstracted operations supporting UFW, nftables, and iptables.
- Dynamic Service Detection: Scans active listening sockets directly via
/proc/net(IPv4/v6, TCP/UDP) to easily select target ports/protocols instead of typing them manually. - SSH Lockout Protection: Automatically tracks session rule changes and reverts them instantly in reverse order if connection is lost (interceptor for
SIGHUPsignal). - Security Audit Logs: Structured logging of all firewall operations to
/var/log/nsmam.logtracking timestamps, backend used, and the real executing user (SUDO_USER/DOAS_USER). - Multiplexer Detection: Warns the administrator if running inside a terminal multiplexer (
tmuxorscreen) where connection drops may bypass the SIGHUP signal.
- Linux OS (Debian, Ubuntu, RHEL, CentOS)
- Rust Toolchain (
cargo&rustcversion 1.80+) only if compiling from source.
You can install NSMAM using either the precompiled standalone binary (no Rust/Cargo toolchain required) or by compiling from source.
- Download the latest
nsmam-x86_64-linuxstatic binary from the GitHub Releases. - Install it to your system path:
sudo cp nsmam-x86_64-linux /usr/local/bin/nsmam sudo chmod +x /usr/local/bin/nsmam
Run the automated installer script:
sudo ./install.shThe script will auto-detect your active firewall backend (or prompt you to force one), configure log file privileges (640 owned by root:adm), compile the release binary, and install it to /usr/local/bin/nsmam.
Launch the TUI interface with root privileges:
sudo nsmam| Key | Action |
|---|---|
a |
Open Add Rule form |
d |
Delete selected rule |
t |
Toggle firewall state (Enable/Disable) |
f |
Flush all rules |
r |
Refresh rules and services |
↑ / ↓ |
Select rules / navigate service list |
Tab / BackTab |
Navigate form inputs |
Space / Enter |
Choose selector values / Submit forms |
Esc / q |
Cancel modals / Quit TUI |
MIT License.
