Linux sudo 事件在哪里报告?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13546933/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 17:51:46  来源:igfitidea点击:

Where are sudo incidents reported?

linuxcommand-linepermissionsdebiansudo

提问by user1717828

Attempting something devious on my machine leads to

尝试在我的机器上进行一些狡猾的事情会导致

ryan@debian:~$ sudo EAT_ALL_THE_COOKIES_BEFORE_DINNER
[sudo] password for ryan: 
ryan is not in the sudoers file.  This incident will be reported.

Where is this incident reported, and how do I get the log of all the nasty attempted commands?

此事件在哪里报告,我如何获取所有令人讨厌的尝试命令的日志?

采纳答案by user1717828

Nevermind, I just found the answer in the alt-text at xkcd:

没关系,我刚刚在xkcd的替代文本中找到了答案:

xkcd838

xkcd838

Replace rootwith your username, in my case ryan, so the log is found with:

替换root为您的用户名,在我的情况下ryan,这样可以找到日志:

cat /var/spool/mail/ryan

回答by qqx

The report is sent as an email to the rootuser. Many Linux distributions will automatically setup an alias for that user directing the mail to the first account created during the install process.

该报告将作为电子邮件发送给root用户。许多 Linux 发行版会自动为该用户设置别名,将邮件定向到在安装过程中创建的第一个帐户。