Centos-sudo detailed configuration and logs

Source: Internet
Author: User
Tags syslog rsyslog

Sudo introduction:
Sudo is a common tool in Linux that allows common users to use superuser permissions;
Sudo features:
<1> sudo can restrict users from running commands only on a host;
<2> sudo provides a wide range of logs, recording in detail what each user has done;
<3> sudo uses a timestamp file to execute a system similar to "check". When a user calls sudo and enters its password, the user obtains a ticket with a storage duration of 5 minutes (this value can be changed during compilation)
<4> the sudoers file is stored in the sudo configuration file at/etc/sudoers by default. The property must be 0411;
Configuration file:
Editing method: Vim; mongodo (this can check whether the configuration is correct)
Sudo mainly includes four alias settings {
Here, the master host_alias # host alias allows access from that host, for example, 192.168.1.1
Determine which commands are allowed to execute cmnd_alias # and add the absolute path. Example:/bin/RM
Alias user_alias # list of users with sudo Permissions
Ranas_alias # identity of the user, for example, root}
Application alias :{
Root all = (all) All
User (XXX) host alias (XXX) = identity alias (XXX) command alias (XXX)
Log configuration :{
<1> touch/var/log/sudo. log # create a log file
<2> Vim/etc/rsyslog. conf # edit the configuration file of the system log [local2.debug/var/log/sudo. log] system logs of centos6 and later versions are rsyslog. conf, the following is syslog}
<3> edit the sudo configuration file: {mongodo
Insert/ults logfile =/var/log/sudo. log at the bottom of the configuration file.
Defaults loglinelen = 0
Defaults! Rsyslog
<4> restart Log Service rsyslog restart}
Note: In some centos6.5 versions, calling rsyslog during mongodo configuration may fail. The solution is to call syslog, for example :! Syslog
Instance :{


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.