AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
  • 1.  configure mailto in sudoers

    Posted Thu April 29, 2010 11:19 AM

    Originally posted by: chpadmin


    Hello,

    How to send the mail to 3 system admins not only send to root thru mailto in file sudoers?

    Thanks.
    #AIX-Forum


  • 2.  Re: configure mailto in sudoers

    Posted Thu April 29, 2010 01:31 PM

    Originally posted by: Juredd1


    In my sudoers file it looks like this;

    Defaults mailto="admin@foobar.com,admin2@roobar.com,admin3@nobar.com"

    Or you can set up alias list in your /etc/aliases file and set up your sudoers file like below.

    Defaults mailto="sudo-admin"

    Hope this helps.
    #AIX-Forum


  • 3.  Re: configure mailto in sudoers

    Posted Thu April 29, 2010 04:13 PM

    Originally posted by: chpadmin


    Thanks your response.

    I tried Defaults mailto = "admin1@com, admin2@com,admin3@com", no email sent out. If only mailto="admin1@.com", it works.

    Defaults mailto="sudo-admin"
    in /etc/aliases: sudo-admin: admin1@com,admin2@com
    is that correct?
    #AIX-Forum


  • 4.  Re: configure mailto in sudoers

    Posted Thu April 29, 2010 05:05 PM

    Originally posted by: Juredd1


    Yes I have seen different examples on ways to set up the mailto part so I am guessing it depends on what version of sudo.

    If you entered mailto="admin1@.com" and sudo did not complain when you saved the file then I would expect if you wanted to use an mail alias you would enter in your sudoers file for example;

    mailto="sudo-admin"

    instead of the email address entry. Then in your /etc/aliases file you would put an entry like you listed in the previous post. The "sudo-admin" part is up to you, you can call it whatever you want.

    Mine looks just like you have it. Don't forget to run /usr/sbin/newaliases so that it re-reads the aliases file or from my testing it won't read the changes.

    So "tail -f /var/log/maillog" on the system and open a second terminal window to test sudo and watch for the email messages to roll through.

    I also entered

    Defaults mail_always

    in the sudoers file. From what I read that will email you on all sudo activity.

    Hope this helps.
    #AIX-Forum


  • 5.  Re: configure mailto in sudoers

    Posted Fri April 30, 2010 10:01 AM

    Originally posted by: chpadmin


    Thank you for your note.

    I run # /usr/sbin/newaliases
    Warning: .cf file is out of date: sendmail AIX5.3/8.13.4 supports version 10 , .cf file is version 9
    WARNING: Group writable directory /var/spool
    WARNING: Group writable directory /var/spool/mqueue
    /etc/mail/aliases: 5 aliases, longest 9 bytes, 72 bytes total

    is it the problem? it still does not work. :-(
    #AIX-Forum


  • 6.  Re: configure mailto in sudoers

    Posted Fri April 30, 2010 11:21 AM

    Originally posted by: chpadmin


    after i changed the sudoers, logout and relogin. It works. Thanks.
    #AIX-Forum


  • 7.  Re: configure mailto in sudoers

    Posted Fri April 30, 2010 12:05 AM

    Originally posted by: zstarsales04


    Zstar Electronic Co.Ltd, Sell fire cards for DS/NDSL/NDSi, also have Wii, DSiLL, NDSi, NDSL, PSP2000, PSP3000, PS2, PS3, PSP go, PSP, Xbox360 accessories, all kinds of phones are available
    www.zstar.hk
    #AIX-Forum