An automated Bash script that generates a full server security and health audit report — checking user access, network exposure, and system resource health in a single run.
- System & Kernel Profile — OS and kernel details (
uname -a) - User & Access Security — flags all accounts with root-level (UID 0) privileges from
/etc/passwd - Active Network Ports — lists all listening ports (
ss -tuln, withnetstatfallback) - Hardware Resources — disk space and memory usage snapshot (
df -h,free -h)
Manually checking a server's security posture and health means running several different commands and piecing the results together. This script automates that into a single, repeatable, timestamped report — the kind of lightweight audit tool a sysadmin might run before a security review or as part of routine health checks.
Running the script generates a clean, structured SECURITY_REPORT.md file with all findings organized into clear sections — system profile, user/access audit, network ports, and hardware resource snapshot.
chmod +x audit_server.sh
./audit_server.shThe report will be saved as SECURITY_REPORT.md in the same directory.
- A Linux system (tested on Ubuntu Server)
- Bash shell
- Standard core utilities (
awk,grep,ss/netstat,df,free)
- Bash scripting & output redirection
awkfor text processing- File permissions & script execution
- Networking commands
- System/hardware monitoring
MIT License — see LICENSE for details.
Built as part of my Linux SysAdmin Journey — 100 Days of DevOps & Cloud Engineering.