Focus on cloud service provider activities
Notes on website operation and maintenance

Linux VPS host regularly clears the history command to ensure server information security

After we get a Linux server, do we start to build the environment and start building the website. But how many of us clean up the log information after operating the command? You should know that our operating commands, including the account user login information, are recorded in the server log, including the command lines used by our backup server. If it is a server security problem, you can pick out your account information and operation account from the log.

 Linux VPS host regularly clears the history command to ensure server information security

So what do we need to do? After the operation is completed, or regularly process and clear the log information, clear the server login and operation account information.

First, clear history execution command

history -c

Or, you can empty the file in the user directory

echo > ./. bash_ history

Or execute:

cat /dev/null > ~/.bash_ history && history -c && exit

Second, clear the record of login failure

Echo>/var/log/wtmp//By default, the code is garbled when it is opened. You can see the IP address and other information
last

Third, clear the record of login failure

Echo>/var/log/btmp//The default code is garbled when opening, and the login failure information is found
Lastb//Login failure information cannot be found

Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Linux VPS host regularly clears the history command to ensure server information security


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge