Created
December 30, 2014 16:34
-
-
Save fimdomeio/937b59f3c04a7a2eb0c3 to your computer and use it in GitHub Desktop.
be warned via xmpp every time a user logs in you linux machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#you'll need xsend.py script from http://xmpppy.sourceforge.net/examples/xsend.py . it's easy enough to get the dependencies | |
#/etc/pam.d/sshd | |
session optional pam_exec.so seteuid /home/YOURUSER/sshlogincmd.sh | |
#~/sshlogincmd.sh | |
#!/bin/bash | |
if [ $PAM_TYPE = "open_session" ]; then | |
/usr/bin/python /home/YOURUSER/xsend/xsend.py [email protected] user $PAM_USER \($PAM_RHOST\) $PAM_TYPE logged in on $HOSTNAME & | |
fi | |
$SSH_ORIGINAL_COMMAND | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment