Linux VPS host regularly clears history commands to ensure server information security

888u

Last update at :2024-06-30,Edit by888u

After we netizens get a Linux server, do we directly start setting up an environment, start building websites, etc.? But how many of us clean up the log information after operating the command? You have to know that when we operate the command, including the account user login information, it is recorded in the server log, including the command line we use to back up the server. There are records. If, that is if there is a server security issue, your account information and operating account can be picked out from the logs.

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

First, clear the history of execution commands

history -c

Alternatively, you can clear the file in the user directory

echo > ./.bash_history

Or execute:

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

Second, clear the records of failed logins to the system

echo > /var/log/wtmp //garbled characters when opened by default, you can see IP and other information last

Third, clear the records of failed logins to the system

echo > /var/log/btmp //garbled characters when opened by default, login failure information found lastb //no login failure information found

Recommended site search: Yangzhou dual-line server overseas server rental price, telecom IP address query, server space, foreign cloud server, domain name query, registered domain name rental, registered domain name, purchase domain name and space, US server,

Linux VPS host regularly clears history commands to ensure server information security

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码