Sunday 10 August 2014

Watcher Script

You just need to set this script to run on startup and there you go, if anyone tries to connected to your pc via ssh,
telnet or ftp then you're going to know about it (I'm using xmessage here but you can set this up to send you an email or show a notification)
#!/bin/bash
tail -fn0 /var/log/auth.log | \
while read line ; do
echo "$line" | grep "Accepted"
if [ $? = 0 ]
then
xmessage "$line" | grep "Accepted"
fi
done

No comments:

Post a Comment