In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Recently, I have been messing with the manjaro xfce version to implement the command audit. Please refer to the following blog
Https://blog.51cto.com/13227377/2159238
The specific operations are as follows:
Add after / etc/profile
# historyexport HISTSIZE=4096DT= `date + "% Y-%m-%d" `export HISTFILE= "/ opt/history/$ {LOGNAME} _ history.log" chmod 600 / opt/history/$ {LOGNAME} 2 > / dev/nullexport PROMPT_COMMAND=' {date "+% Y-%m-%d% T # $(history 1 | {read x cmd; echo" $cmd ";})";} > > $HISTFILE'
After adding, it was found that the PROMPT_COMMAND variable did not take effect, that is, the record format of log in the log file was not changed, and later found that the user environment variable reset PROMPT_COMMAND.
The solution is as follows:
Step one:
Sudo gedit / etc/bash.bashrc
Comment out some of the code in the figure
Step 2:
Gedit / .bashrc
Comment out some of the code in the figure
Step 3:
Source / etc/bash.bashrcsource ~ / .bashrc
At this moment, the format in history.log has been changed to the format set in the command audit.
The log format changes as follows
Before modification
After modification
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.