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
|