View linux login log centos7

Linux login to view the log
1, lastlog lists information for all users recently logged

  lastlog reference is / var / log / lastlog file information, including name-the Login, Port, the Login Last Time

 2, list the current and former Login Last user information systems

, which by default is the information read / var / log / wtmp file. Content output include: user name, terminal location, login information source, start time, end time, duration. Note the last line of the output is recorded in wtmp file start time. Of course, the parameters can be specified by the read last -f file, may be / var / log / btmp, / var / run / utmp

Syntax: last [-R] [-num] [-n num] [-adiowx] [- f file] [-t YYYYMMDDHHMMSS] [ name ...] [tty ...]

example: last -x: display system closed, users log in and out of history

          last -i: display cases specific ip logged

          last -t 20181010120101 : 20181010120101 displayed before login information
3, lastb list of failed attempts to log information

and the last command functions exactly the same, except that it is the default read information / var / log / btmp file. Of course, the file can also be specified by the read last -f parameter may be / var / log / btmp, / var / run / utmp

 

Guess you like

Origin www.cnblogs.com/wangdidi/p/10955004.html