Debianzone

« Back to posts
  • Viewed
    times

Filed under

  • Others
  • mail alert
  • security
  • ssh
November 28, 2009

Mail alert for ssh login

  • Edit
  • Delete
  • Tags
  • Autopost
To get a mail when some logged into your linux system then follow this steps Edit .bashrc in root folder /root [shell] vi .bashrc [/shell] Add following line at end of the file [shell] echo 'ALERT - Root Shell Access (server name) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" yourmail@gmail.com[/shell]
  • 0 responses
  • Like
  • Comment