Send email on authentication

General support questions
Post Reply
Darm0ka
Posts: 2
Joined: 2017/10/17 10:25:32

Send email on authentication

Post by Darm0ka » 2017/10/23 14:20:27

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.

Darm0ka
Posts: 2
Joined: 2017/10/17 10:25:32

Re: Send email on authentication

Post by Darm0ka » 2017/10/28 17:01:30

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

Post Reply