Alerte au login

Date 9/11/2009 9:15:41 | Sujet : Configurations

Comment être alerté d'une connexion sur le serveur?

Il suffit d'ajouter cette ligne  (echo 'ALERT ...) au fichier .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" email@example.com

 


Voilà.

De cette manière, à chaque fois qu'il y aura une connexion via ssh, vous recevrez un mail.

 Franck





Cet article provient de Asterisk AGMP
http://asterisk.agmp.org

L'adresse de cet article est :
http://asterisk.agmp.org/modules/news/article.php?storyid=13