Review (1)

Source: Internet
Author: User
Tags syslog rsyslog

Sudo

Running the Visudo command directly will open the Vim editor. Edit/etc/sudoers.tmp.

[Email protected] ~]# Visudo Visudo:/etc/sudoers.tmp unchanged
Chomperwu all= (Root)/usr/sbin/useradd,/usr/sbin/passwd

Effective immediately after the change!

Add an entry. All means that root indicates in what capacity to run the command anywhere.

This entry indicates that the CHOMPERWU user has permission to run the USERADD,PASSWD command as root .

#切换到chomperwu, add sudo before running the command.

[[email protected] ~]$ sudo useradd test1[sudo] password for CHOMPERWU:

The which command can be used to view the directory of commands

[email protected] ~]$ which PASSWD/BIN/PASSWD

Virtual Machine Management Commands

Virsh: Managing virtual machines, interactive commands

Virt-manager: Graphical interface


RPM Package

RPM-IVH: Installation Package

RPM-QL: Query packages for which files are installed

RPM-QF file: Find out which installation package this file belongs to


If the package is not yet installed, query information using the-P option

RPM-PQL: See which files are installed by the package

RPM-PQ--scripts: What scripts were executed before and after the query was installed.


Yum Warehouse

[Dvd]name=dvdbaseurl=file:///mntgpgcheck=0

Log

/etc/rsyslog.conf configuration files for System management logs

Rules that define the generation of logs

# log anything  (except mail)  of level info or higher.# don ' t  log private authentication messages!*.info;mail.none;authpriv.none;cron.none                 /var/log/messages#  the authpriv file has restricted access.authpriv.*                                                 /var/log/secure# log all the mail messages in  one place.mail.*                                      &nbsP;             -/var/log/maillog# log  cron stuffcron.*                                                     /var/log/cron# Everybody gets emergency messages*.emerg                                                    :omusrmsg:*# save news errors of  level crit and higher in a special file.uucp,news.crit                                            /var/log/ spooler# save boot messages also to boot.loglocal7.*                                                   /var/log/boot.log

Log level (8): Debug,info,notice,waring,

Err,crit,alert,emerg.

How to do log server

Port used by log server: 514/UDP

Server-side configuration

Open the following 4 options in the configuration file, and then restart the Rsyslog service

# provides UDP syslog reception$modload imudp$udpserverrun 514# provides TCP syslog reception$modload Imtcp$inputtcpserve Rrun 514

Client Configuration

The client and server side need to open those 4 ports!

Then define a log-generated entry, for example:

*.info @server0

Then restart the service and it's OK.


Logger command: Manually add logs.

[Email protected] log]# logger-p mail.info Nihao

-P: Specifies the device, log level. If you do not add the-p option, it is recorded in the message.

Polling for logs

/etc/logrotate.conf configuration file







Review (1)

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.