RedHatLinux common log files-Linux general technology-Linux technology and application information, the following is a detailed description. Common RedHat Linux Log Files are described as follows:
/Var/log/boot. log
This file records the system events during the boot process, that is, the information displayed during the Linux system boot self-check process.
/Var/log/cron
This log file records the actions of sub-processes derived from the crontab daemon crond, followed by the user, Logon Time, PID, and derived process actions. One CMD action is a common situation where cron derives a scheduling process. REPLACE action records the updates to its cron file, which lists the task scheduling to be periodically executed. The RELOAD action occurs shortly after the REPLACE action, which means cron notices that a user's cron file is updated and cron needs to RELOAD it into the memory. This file may find some unusual situations.
/Var/log/maillog
This log file records every activity that is sent to or from the system by email. It can be used to view which system sending tool the user uses or which system the data is sent. The following is a snippet of the log file:
This log file is a summary of many process log files, from which you can see any intrusion attempt or successful intrusion. For example:
Reference:
Sep 3 08:30:17 UNIX login [1275]: failed login 2 FROM (null) FOR suying,
Authentication failure
Sep 4 17:40:28 UNIX -- suying [2017]: login on pts/1 BY suying FROM
Fcceec.www.ec8.pfcc.com.cn
Sep 4 17:40:39 UNIX su (pam_unix) [2048]: session opened for user root by suying (uid = 999)
The format of this file is that each line contains a date, host name, program name, followed by square brackets containing the PID or kernel ID, a colon and a space, and finally a message. This file has one disadvantage: The recorded intrusion attempts and successful intrusion events are drowned in a large number of normal process records. However, this file can be customized by the/etc/syslog file. The/etc/syslog. conf configuration file determines how the system writes/var/messages. How to configure the/etc/syslog. conf file to determine the behavior of system log records will be described in detail later.
/Var/log/syslog
By default, RedHat Linux does not generate this log file, but you can configure/etc/syslog. conf to allow the system to generate this log file. It is different from the/etc/log/messages log file. It only records warning information, which is often the information of system problems. Therefore, you should pay more attention to this file. To have the system generate the log file, go to/etc/syslog. add the following to the conf file :*. warning/var/log/syslog this log file records information such as the wrong password, Sendmail issue, and su command execution failure recorded by login during user logon. Below is a record:
This log file records the recent successful logon events and the last unsuccessful logon events, which are generated by login. This file is a binary file and needs to be viewed using the lastlog command. The username, port number, and last logon time are displayed according to the UID sorting. If a user has Never logged on, it is displayed as "** Never logged in **". This command can only be executed as root. Simply enter the lastlog command and you will see information similar to the following:
Reference:
Username Port From Latest
Root tty2 Tue Sep 3 08:32:27 + 0800 2002
Bin ** Never logged in **
Daemon ** Never logged in **
Adm ** Never logged in **
Lp ** Never logged in **
Sync ** Never logged in **
Shutdown ** Never logged in **
Halt ** Never logged in **
Mail ** Never logged in **
News ** Never logged in **
Uucp ** Never logged in **
Operator ** Never logged in **
Games ** Never logged in **
Gopher ** Never logged in **
Ftp UNIX Tue Sep 3 14:49:04 + 0800 2002
Nobody ** Never logged in **
Nscd ** Never logged in **
Mailnull ** Never logged in **
Ident ** Never logged in **
Rpc ** Never logged in **
Rpcuser ** Never logged in **
Xfs ** Never logged in **
Gestation ** Never logged in **
Postgres ** Never logged in **
Apache ** Never logged in **
Lzy tty2 Mon Jul 15 08:50:37 + 0800 2002
Suying tty2 Tue Sep 3 08:31:17 + 0800 2002
System accounts such as bin, daemon, adm, uucp, and mail should never be logged on. If these accounts have been logged on, the system may have been intruded. If the recorded time is not the time the user logged on to the console, the user's account has been leaked.
/Var/log/wtmp
This log file permanently records the logon, logout, and system startup and shutdown events of each user. Therefore, as the system runs normally, the file size increases, depending on the number of system user logins. This log file can be used to view the user's logon records. The last command obtains this information by accessing this file and displays the user's logon records in reverse order, last can also display corresponding records based on the user, terminal tty or time.
The last command has two optional parameters:
The last-u User Name displays the user's last logon status.
The last-t days show the user logon status before the specified number of days.
/Var/run/utmp
This log file records information about each user currently logged on. Therefore, this file will change as the user logs in and out of the system. It only keeps the user records online at the time and does not keep permanent records for the user. Programs in the system that need to query the current user status, such as who, w, users, and finger, need to access this file. This log file does not contain all accurate information, because some unexpected errors will terminate the user logon session, and the system does not update the utmp record in time, therefore, the log file is not trustworthy.
The three files mentioned above (/var/log/wtmp,/var/run/utmp,/var/log/lastlog) are key files of the log subsystem, all records the user logon status. All records of these files contain timestamps. These files are saved in binary format. Therefore, you cannot directly view these files using commands such as less and cat. Instead, you need to use relevant commands to view these files. The data structure of the utmp and wtmp files is the same, while the lastlog file uses another data structure. You can use man to query the specific data structure of the utmp and wtmp files.
Each time a user logs on, the login program checks the user's UID in the lastlog file. If so, the user's last logon, logout time, and host name are written to the standard output. Then, the login program records the new Logon Time in lastlog, opens the utmp file, and inserts the user's utmp record. This record is always deleted when the user logs on and exits. The utmp file is used by various commands, including who, w, users, and finger.
Next, the login program opens the file wtmp and attaches the user's utmp record. When a user logs on and exits, the same utmp record with the updated timestamp is appended to the file. The wtmp file is used by the program last time.
/Var/log/xferlog
This log file records FTP sessions and displays the files that the user copied to or from the FTP server. This file displays the malicious programs copied to the server to invade the server, and the files copied by the user for use.
The format of the file is: the first domain is the date and time, the second domain is the number of seconds the file was downloaded, the remote system name, the file size, local path name, transmission type (: ASCII, B: Binary), compression-related flag or tar, or "_" (if not compressed), transmission direction (relative to the server: I indicates inbound, o stands for outbound), access mode (a: Anonymous, g: Enter password, r: real user), user name, service name (usually ftp), authentication method (l: RFC931, or 0), authenticate the user ID or "*". Below is a record of the file:
Reference:
Wed Sep 4 08:14:03 2002 1 UNIX 275531
/Var/ftp/lib/libnss_files-2.2.2.so B _ o a-root @ UNIX ftp 0 * c
/Var/log/kernlog
RedHat Linux does not record this log file by default. To enable this log file, you must add a line in the/etc/syslog. conf file: kern. */var/log/kernlog. In this way, all kernel messages are recorded in the/var/log/kernlog file. This file records the status of loading devices or using devices when the system starts. It is generally a normal operation, but if you have recorded the operations performed by unauthorized users, you should note that this is probably the behavior of malicious users. The following is part of the file:
This log file records the startup of X-Window. In addition to/var/log/, malicious users may also leave traces elsewhere. Pay attention to the following: root and shell history files of other accounts; users' mailboxes, for example. sent, mbox, and emails stored in/var/spool/mail/AND/var/spool/mqueue; temporary files/tmp,/usr/tmp,/var/tmp; hidden directory; files created by other malicious users are usually "..
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