When you manage your own VPS, keeping it secure goes far beyond setting up a strong password or using SSH keys. One of the most important — and often overlooked — tasks is monitoring login attempts and file changes.
If someone tries to brute-force their way into your server or modifies system files without authorization, you need to know immediately. In this post, we’ll walk you through simple tools and methods to keep an eye on your VPS security 24/7.
For automation, schedule this via cron and configure it to email alerts.
🔁 Real-Time File Monitoring with
inotify-tools
For lightweight, real-time file monitoring (e.g., for specific web directories), use inotify-tools.
🔧 Install:
sudo apt install inotify-tools -y
Example: Watch for changes in
/var/www/html
:
inotifywait -m -r /var/www/html
This tool is great for developers and sysadmins wanting immediate feedback on file activity.
✉️ Optional: Email Alerts for Login & File Events
Combine these tools with email notifications or integrate them with your external monitoring system (Zabbix, Prometheus, or even a simple bash + mail setup) for real-time alerting.
🧠 Best Practices
🔐 Use SSH keys instead of passwords
🔒 Disable root login via SSH
🚫 Change default SSH port
📉 Monitor logs daily or automate alerting
🧾 Keep audit trails and backups
💡 All Hosteons VPS & VDS Plans Support These Tools