Hello, I am trying to get receive notifications, when some got wrong ssh credentials.
In /etc/pam.d/sshd I add
then -> chmod +x /usr/local/bin/alert.sh
in file I got
It works, but I receive correct and non correct logins.
How to make to receive only wrong logins?
In /etc/pam.d/sshd I add
Code:
auth optional pam_exec.so /usr/local/bin/alert.sh
in file I got
Code:
#!/bin/sh
echo "SSH auth failure: User=$PAM_USER From=$PAM_RHOST SERVICE:$PAM_SERVICE on HOST:`hostname`" \
| mail -s "FreeBSD SSH Auth Fail" my_maildot@
It works, but I receive correct and non correct logins.
How to make to receive only wrong logins?