server-scripts/mail_on_ssh
2023-05-18 22:47:21 -07:00
..
.gitignore Add script that sends email if user successfully logs in over SSH 2023-05-18 22:47:21 -07:00
mail_on_ssh.conf.example Add script that sends email if user successfully logs in over SSH 2023-05-18 22:47:21 -07:00
mail_on_ssh.sh Add script that sends email if user successfully logs in over SSH 2023-05-18 22:47:21 -07:00
README.md Add script that sends email if user successfully logs in over SSH 2023-05-18 22:47:21 -07:00

Installation

After setting up mail_on_ssh.conf, add the following configuration to /etc/pam.d/sshd

# Send an email if somebody logs in successfully over SSH
session    optional     pam_exec.so seteuid $PATH2SERVER_SCRIPTS/mail_on_ssh/mail_on_ssh.sh -c $PATH2SERVER_SCRIPTS/mail_on_ssh/mail_on_ssh.conf