If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

28 Responses

  1. Aida Dudley says:

    After I originally left a comment I seem to have clicked on the Notify me when new comments are added- checkbox and now each time a comment is added I receive four emails with the exact same comment. There has to be a way you are able to remove me from that service? Thanks a lot!

  2. Arira Joseph says:

    When I tried logging in as root, I get this error message. what does this mean?

    mail: option requires an argument -- 's'
    Try 'mail --help' or 'mail --usage' for more information.
    bash: $'Alert: Root Access from ip-address\nip-address': command not found
    
  3. santhoshs says:

    Sir, I need one help from you.

    can’t I get any user login email alert through the mail? I have tried but mail.err and mail log gives me an error. below is the code (changed hostname, email)

    echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" [email protected]

    I have written a script for capturing an image and email later notification

    • Ravi Saive says:

      @Santhos,

      Could you share your maillog error logs here? so that it would help us in solving your problem.

      • Mike says:

        Ravi – do you know why I would see :0 instead of an IP Address? Please let me know.

        ALERT – Root Shell Access (server-here) on: Mon May 1 11:52:31 EDT 2017 username-here tty7 2017-05-01 11:48 (:0)

        • Ravi Saive says:

          @Mike,

          Have you added following code correctly to your .bashrc file?

          echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" [email protected]

          • Mike says:

            Yes – and it works great every time I log in! But I had one time where I did not log into the system but got an email and it was from “:0” so I was wondering if that may have been the system or something else?

          • Mike says:

            @Ravi,any word on the “:0”? It works great when I log in but one time when no one logged in I got an email with “:0” as the login … I thought it was odd…

  4. Mike says:

    @Ravi Saive – what does it mean when I see :0 instead of an IP Address? See below:

    ALERT – Root Shell Access (server-here) on: Mon May 1 11:52:31 EDT 2017 username-here tty7 2017-05-01 11:48 (:0)

  5. Savannah Bradshaw says:

    Hi, I think your site might be having browser compatibility issues. When I look at your blog in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, very good blog!

  6. Glinda Blaubaum says:

    Excellent post.Ne’er knew this, thank you for letting me know.

  7. Gilang says:

    Hi, how to make two email out to inform the admin?
    thanks

  8. Edwin says:

    Hi,
    I always get the message (mail.log) “no recepient address found in message header”
    Where is this recepient address specified?

    Thanks for yr help im desperate..

    With kind regards,

    Edwin

  9. randhir says:

    Hi how can we set ssh mail alert othere then one specific ip.

    I want to set ssh login root mail alert same working as well now my requirment is i want to get ssh root alert mail if other then one specific ip are
    login.

    Thanks & regdras
    Randhr

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *