Home > other >  Linux user login record and command history method
Linux user login record and command history method

Time:09-16

Remove landing system successful record
[root @ localhost root] # echo & gt; The/var/log/WTMP//this file is opened by default gibberish, can find the information such as IP
[root @ localhost root] # last//at this point do not check the user login information

Remove landing system failure record
[root @ localhost root] # echo & gt; The/var/log/BTMP//this file is opened by default gibberish, logon failure information can be
[root @ localhost root] # lastb//not logon failure information

Execute the command clear history
[root @ localhost root] # history - c//empty execute the command history
[root @ localhost root] # echo & gt; ./.bash_history//or empty the user directory of the file

Import empty history
[root @ localhost root] # vi/root/history//new log files
[root @ localhost root] # history - c//clear record
[root @ localhost root] # history - r/root/history. TXT//import record
[root @ localhost root] # history//check the import results

Example
[root @ localhost root] # vi/root/history
[root @ localhost root] # history - c
[root @ localhost root] # history - r/root/history. TXT
[root @ localhost root] # history
[root @ localhost root] # echo & gt; The/var/log/WTMP
[root @ localhost root] # last
[root @ localhost root] # echo & gt; The/var/log/BTMP
[root @ localhost root] # lastb
[root @ localhost root] # history - c
[root @ localhost root] # echo & gt; ./.bash_history
[root @ localhost root] # history

CodePudding user response:

So that you can do wrong rm/* ha ha
  • Related