Skip to content

Get notification when a new SSH connection is opened.

Notifications You must be signed in to change notification settings

snackk/LogWatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log watcher

Overview

I personally use this script to monitor my own servers, and to send me an email in case of someone's trying to access them. At the moment this script is only monitoring the ssh connection and using Gmail's client to send an email.

Before running it

You'll have to create the ambient variables:

$ export log_email_from="your.email@gmail.com"
$ export log_email_to="your.email@account"
$ export log_passwd="email.password"

After that you have to clone the repo and run it at startup, haven't tested yet, but guess it's something like this:

$ cd ~ 
$ mkdir git && cd git
$ git clone https://github.com/snackk/logwatcher
$ cd logwatcher
$ sudo cp LogsWatcher.sh /etc/init.d/
$ sudo chmod 755 /etc/init.d/LogsWatcher.sh
$ sudo update-rc.d LogsWatcher.sh defaults

If everything works as expected, you should receive an email everytime someone's log on to your machine, including yourself.

Written by @snackk

About

Get notification when a new SSH connection is opened.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published