我在尝试获取 ossec 功能时收到错误:电子邮件通知。我在这个案例中使用了我的 Gmail 帐户。我试过这个tutorial https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ossec-security-notifications-on-ubuntu-14-04,
但我无法收到任何电子邮件。我收到了带有警告的错误日志Mail not accepted by server
。它位于/var/ossec/logs/ossec.log
你可以看到下面的日志。
2017/10/06 20:05:18 os_sendmail(1764): WARN: Mail from not accepted by server
2017/10/06 20:05:18 ossec-maild(1223): ERROR: Error Sending email to 74.125.200$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Starting syscheck scan (forwarding d$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Starting syscheck database (pre-scan$
2017/10/06 20:05:58 ossec-syscheckd: INFO: Initializing real time file monitori$
这是我的电子邮件配置ossec.conf
位于/var/ossec/etc/ossec.conf
<global>
<email_notification>yes</email_notification>
<email_to>[email protected] /cdn-cgi/l/email-protection</email_to>
<smtp_server>smtp.gmail.com.</smtp_server>
<email_from>ossecm@gantz-X450CC</email_from>
<email_maxperhour>20</email_maxperhour>
<email_from>my[email protected] /cdn-cgi/l/email-protection</email_from>
</global>
我已填满我的<smtp_server>
to smtp.gmail.com
。一切都没有改变。我的仍然收到错误消息ossec.log
我怎样才能解决这个问题 ?我安装这个应用程序Ubuntu Server: 16.04
我终于得到了解决方案。对于我的情况,我使用了Postfix https://documentation.wazuh.com/current/user-manual/manager/manual-email-report/smtp_authentication.html将我的 Gmail 帐户连接到我的本地主机。如果您有自己的专用电子邮件服务器,就像在您的服务器中一样,那就太好了,而不是使用 gmail。
-
确保您已更新您的 Linux。
apt-get update
-
通过终端安装 postfix ,如果您无法安装 postfix,请尝试更改您的存储库位置/etc/sources.list
然后更新你的linux使用apt-get update
,直到您可以运行以下命令
sudo apt-get install postfix
or
sudo apt-get install mailutils
这将安装 Postfix 以及需要很少的其他程序 https://documentation.wazuh.com/current/user-manual/manager/manual-email-report/index.html。之后你会看到选项,选择互联网网站
-
配置后缀
Search main.cf
at /etc/postfix/main.cf
,使用编辑文件nano
。在文件末尾添加此语法。
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
Edit sasl_passwd
at /etc/postfix/sasl_passwd
,编辑文件并将以下行添加到sasl_passwd
file:
[smtp.gmail.com]:587 your_email_here:your_password here
您应该将您想要作为 ossec 电子邮件通知发件人的电子邮件放在“sasl_pawd”上。不作为接收者。
-
编辑你的/var/ossec/etc/ossec.conf
,然后将您的 SMTP 更改为本地 IP,例如127.0.0.1
or localhost
<global>
<email_notification>yes</email_notification>
<email_to>your email that want to be send to</email_to>
<smtp_server>localhost</smtp_server>
<email_from>127.0.0.1</email_from> #if 127.0.0.1 didnt work ,try same email address which you put in your sasl passwd
<email_maxperhour>100</email_maxperhour>
</global>
更新于 22/05/2018
如需进一步配置,请阅读this https://documentation.wazuh.com/current/user-manual/manager/manual-email-report/smtp_authentication.html教程和this https://documentation.wazuh.com/current/user-manual/manager/manual-email-report/index.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)