This Code Send Notification on Discord TextChannel When SSH Login and logout its happen .
Clone Repository in /sbin
Directory :
cd /sbin
git clone https://github.com/zi-gax/SSH-Monitor
Add Webhook URL : (line 3)
WEBHOOK_URL=" "
Edit Permission File :
sudo chmod +x /sbin/SSH-Monitor/SSH-MONITOR.sh
sudo chown root:root /sbin/SSH-Monitor/SSH-MONITOR.sh
Add This Line To /etc/pam.d/sshd
:
session optional pam_exec.so /sbin/SSH-Monitor/SSH-MONITOR.sh
Restart The sshd
:
sudo systemctl restart sshd