E-mail SSH Connections
This solution applies if you want to receive an e-mail when one connects to your server via SSH. open a command line and type in :
1 |
vim ./.bashrc |
at the end of the file add the following command :
1 2 |
# Email Notification on ssh connexion echo 'NOTIFICATION - SSH acces in USERNAME on `hostname` the:' `date` `who` | mail -s "NOTIFICATION - Connexion ssh from : `who | cut -d"(" -f2 | cut -d")" -f1`" your_email@email.com |
When one will now connect to your server, you will receive an advertisement e-mail.
Also tagged connection, ssh