Send email on authentication
Send email on authentication
Im making a ssh multiple factor authentication an I can easily send an email after authentication, what I want to know is if is possible to send an email in every step of authentication, if in sshd_config i have AuthenticationMethods publickey,password,keyboard-interactive, is possible send an email after publickey authentication, other email after password authentication and other after keyboard-interactive authentication? I think is possible using PAM but I dont know how to do it.
Re: Send email on authentication
I found a solution based on ommail to send syslog messages via mail.
I put a script in /etc/rsyslog.d/ that trigger an email if a specific log matches my condition.
I also change in sshd_config LogLevel INFO to LogLevel VERBOSE
My solution was based on this link: https://unix.stackexchange.com/question ... n-attempts
I put a script in /etc/rsyslog.d/ that trigger an email if a specific log matches my condition.
I also change in sshd_config LogLevel INFO to LogLevel VERBOSE
My solution was based on this link: https://unix.stackexchange.com/question ... n-attempts