Schnipsel: SSH Benachrichtigung -> Profile

if [ ! -z "$SSH_CLIENT" ]; then
	CINFO=`echo $SSH_CLIENT |awk -F" " {'print $1'}`
	HINFO=`host $CINFO| awk -F " " {'print $5'}`
        echo 'Login on' `hostname` `date` `echo $CINFO / $HINFO` | mail -s "Login on `hostname` $CINFO / $HINFO"  admin@meine-domain.de
	unset CINFO && unset HINFO
fi

Tags:, , ,