Skip to content

dewittgibson-kpmg/Linux-file-monitor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Linux-file-monitor

I'll create a monitoring script that checks critical files for modifications and alerts you to any changes. This can help detect potential security breaches or unauthorized modifications.​​​​​​​​​​​​​​​​

This script creates a file integrity monitoring system. Here's how to use it:

  1. Save the script to a file (e.g., file_monitor.sh)
  2. Make it executable: chmod +x file_monitor.sh
  3. Initialize the database: sudo ./file_monitor.sh init
  4. Run checks: sudo ./file_monitor.sh check

Key features:

  • Monitors critical system directories
  • Creates SHA256 hashes of files
  • Detects any modifications to files
  • Logs changes with detailed information
  • Sends alerts through multiple channels (email, desktop notifications, system journal)
  • Records file permissions, ownership, and timestamps

To automate monitoring, add it to crontab:

# Check every hour
0 * * * * /path/to/file_monitor.sh check

Be sure to:

  1. Modify the WATCH_DIRS variable to include your critical directories
  2. Update the EMAIL variable with your email address
  3. Secure the hash database and log files
  4. Consider storing the hash database on a separate, secure system

Would you like me to add any additional security features or modify the monitoring parameters?​​​​​​​​​​​​​​​​

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%