Posted By

arnoldb on 07/21/09


Bash ssh alert

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


SSH Access Email Alert

 / Published in: Bash


Simply change the email address and add this to the bottom of your .bashrc file in your home directory. You may also want to add this to the .bashrc in the /root directory, and the .profile in /etc to ensure you are notified anytime your server is accessed via SSH.

  1. echo[SSH] – SSH access to SERVERNAME on:’ `date` `who` | mail -s “SSH access from `who | cut -d”(-f2 | cut -d”)” -f1`”

Report this snippet  

You need to login to post a comment.