Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
NickTheGreek

Email notification upon shell login

Recommended Posts

http://www.2daygeek.com/how-to-set-up-email-alert-on-all-user-ssh-login/

just append the following line to your

/etc/bashrc

 

or /root/.bash_profile

echo 'ALERT - Shell Access to ' $HOSTNAME ' on: ' `date` `who` | mail -s "$HOSTNAME Alert: Access from `who | awk '{print $5}'`" {YOUR EMAIL HERE}

 

θα λαμβανετε κατι τετοιο μετα ( προϋπόθεση να υπάρχει εγκατεστημένο MTA στο σύστημα, πχ σε CentOS απλα yum install mailx -y)

 

ALERT - Shell Access to  XXXXXX  on:  Tue Nov 8 10:36:46 CET 2016 USER pts/0 2016-11-08 10:36 (x.x.x.x)

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Μπορούμε πολύ απλά να τσεκάρουμε auth.log στο var/log directory αν κάποιος μπήκε  αλλα μάρεσε αυτη η γραμμή θενξ!

Share this post


Link to post
Share on other sites

Το θεμα δεν ειναι τοσο να βρουμε ποιος μπηκε κατόπιν εορτής όσο να λαμβάνουμε ειδοποιήσεις σε email realtime

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×