Environment: Ubuntu12.04server. The permission of sudo is assigned to mongodo for management. Examples are available in/usr/share/doc/sudo/examples/sample. sudoers. Because the rsyslog (RemoteSystemLog) is used in Ubuntu12.04 and is an upgraded version of syslog, but the method of use is the same as that of syslog. Many materials found on the internet refer to modifying/etc/syslog. con.
Environment: Ubuntu 12.04 server.
The permission of sudo is assigned to mongodo for management. Examples are available in/usr/share/doc/sudo/examples/sample. sudoers.
Because rsyslog (Remote System Log) is used in Ubuntu 12.04 and is an upgraded version of syslog, but the usage method is the same as that of syslog. Many information found on the internet says to modify/etc/syslog. conf file (this is used in many other versions of linux and later versions of ubuntu), actually modify/etc/rsyslog. conf is the same.
1. Configure/etc/rsyslog. conf
Add a line: local2.debug/var/log/sudo. log (separated by tab in the middle)
2. the root user executes the mongodo modification/etc/sudoers file:
Add:
##
# Override built-in defaults
##
Defaults syslog = auth
Defaults> ALL! Set_logname
Ults: FULLTIMERS! Lecture
Ults: millert! Authenticate
Defaults @ SERVERS log_year, logfile =/var/log/sudo. log
Defaults! PAGERS noexec
Defaults logfile =/var/log/sudo. log
3. Restart rsyslog
Service rsyslog restart
4. Inspection
We can see that the sudo. log file is generated under/var/log. The following is a record of the wrong sudo operation:
Tsli @ ubuntu:/usr/lib $ sudo ls
[Sudo] password for tsli:
Tsli is not in the sudoers file. This incident will be reported.
Reading:
Linux how to add users to become sudoers http://www.linuxidc.com/Linux/2013-06/86098.htm
Linux basics -- sudoers file writing http://www.linuxidc.com/Linux/2013-06/85347.htm
Defining Linux User Permissions is up to you -- sudo command http://www.linuxidc.com/Linux/2013-04/83580.htm
Automatically add sudo permission script http://www.linuxidc.com/Linux/2012-11/74471.htm
Linux configure sudo permission http://www.linuxidc.com/Linux/2012-10/71795.htm
Sudo configuration temporary get root privileges http://www.linuxidc.com/Linux/2012-09/69525.htm
CentOS sudo command configuration http://www.linuxidc.com/Linux/2012-08/67841.htm
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2