Explain script : 0 7 * * * grep “Failed password” /var/log/auth.log | awk ‘{print $(NF-3)}’ | sort | uniq -c | sort -rn > /tmp/ssh_fail.txt
This is a Linux Crontab + Bash command pipeline used for SSH security monitoring. It runs every day at 7:00 AM, searches SSH authentication logs for failed login attempts, extracts the suspected source IP addresses, counts failed attempts per IP, sorts…
Check disk space with bash script
Bash monitoring script that checks the disk usage of the root filesystem (/). If disk usage exceeds 80%, it sends an email alert to the system administrator. Let’s break it down line by line. 1. Complete script 2. Explain each command Line 1:…