Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to clear Bash logging in Ubuntu system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to clear Bash log records in the Ubuntu system", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to clear Bash log records in Ubuntu system".

1. In penetration testing, to clear the current bash operation, many people will directly history-c clear, but this will empty all .bash _ history, and the administrator with a little common sense will be able to find the problem immediately. Solving this is simple:

The right thing to do is to implement it before launch.

The code is as follows:

Export HISTFILE=/dev/null

Export HISTSIZE=0

That's it.

two。 When logging in to the system, enter the following command directly, and the history will not be recorded after logging in to SSH

The code is as follows:

Unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG

Export HISTFILE=/dev/null

Export HISTSIZE=0

Export HISTFILESIZE=0

3. The most abnormal place to keep a log.

The code is as follows:

[root@c2 ~] # vi / root/.bash_history

The log in this place is the ultimate log and cannot be deleted directly. It needs to be replaced. See the following tips, or modify it directly.

4. Delete the IP skills in the log

The code is as follows:

Sed-I's abc.txt 192.168.100.252 abc.txt 127.0.0.1

At this point, I believe you have a deeper understanding of "how to clear Bash log records in the Ubuntu system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report