Wednesday, September 6, 2017

Send mail on ssh login and logout

Login
/etc/ssh/sshrc

Logout
/etc/pam.d/sshd

session optional pam_exec.so quiet /etc/pam_session.sh

/etc/pam_session.sh

#!/bin/sh
if [ "$PAM_TYPE" = "close_session" ]; then
something
fi

https://unix.stackexchange.com/questions/136548/force-command-to-be-run-on-logout-or-disconnect

No comments:

Blog Archive