Skip to content

rubikproxy/SSHALERT

Repository files navigation

SSH ALERT SERVICE

SSH_ALERT Logo


Overview

SSH_ALERT is a Python-based monitoring tool that sends real-time notifications for SSH login attempts (successful and failed) via Telegram. It monitors SSH authentication logs to provide instant alerts, enhancing server security by keeping you informed of access activities.


Installation and Setup

Prerequisites

Ensure the following software is installed:

  • Python 3: Install using:
    sudo apt install python3
  • pip: Install using:
    sudo apt install python3-pip
  • rsyslog: Used for logging SSH authentication attempts.

Install and Configure Rsyslog

  1. Install Rsyslog:

    sudo apt install rsyslog
  2. Verify Rsyslog:

    rsyslogd -v
  3. Enable Authentication Logging:

    • Edit Rsyslog configuration:
      sudo nano /etc/rsyslog.conf
    • Ensure this line is uncommented:
      auth,authpriv.*    /var/log/auth.log
  4. Restart Rsyslog:

    sudo systemctl restart rsyslog

Configure SSH_ALERT

  1. Clone the Repository:

    git clone https://github.com/rubikproxy/SSHALERT.git
  2. Navigate to SSH_ALERT Directory:

    cd /SSHALERT/
  3. Try To Run this script:

    bash main.sh

  • Enter Your Telegram bot_token
  • Enter Your Telegram chat_id

Usage Command

  1. Service Management:
    • Start the Service:
      sudo service sshalert start
    • Check Service Status:
      sudo service sshlert status
    • Restart the Restart:
      sudo service sshlert restart

Verify Installation

To confirm that sshalert is running, check the process:

ps aux | grep sshalert

Usage

SSH_ALERT automatically monitors /var/log/auth.log for SSH login attempts and failed logins, sending real-time notifications to your configured Telegram chat.

Logging

All alerts are logged to /var/log/SSH-Alert/sshalert.log within the SSHALERT directory for easy tracking and analysis.


Troubleshooting

  • Log Checking: If alerts aren't sent, check tail -f /var/log/SSH-Alert/sshalert.log for errors.
  • Permission Issues: Run the script with root permissions.

Conclusion

SSH_ALERT is a powerful, simple-to-use tool to monitor SSH access and keep your server secure. Regularly check logs and update bot credentials as needed to ensure continuous operation.

About

SSH_ALERT is a Python-based monitoring tool that sends real-time notifications for SSH login attempts (successful and failed) via Telegram

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages