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 hide History record in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces "how to hide History records in Linux". In daily operation, I believe that many people have doubts about how to hide History records in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to hide History records in Linux". Next, please follow the editor to study!

Sometimes for the sake of server security and preventing others from snooping on the command we enter, we can empty the history, and more often, we choose to force the history not to remember the command when entering a special command.

Experimental method: first execute the export HISTCONTROL=ignorespace command, and then output the ls-tra, pwd and service mysqld start commands in turn. When we execute the third command, we choose not to remember the command.

[root@VM_96_242_centos ~] # export HISTCONTROL=ignorespace

[root@VM_96_242_centos ~] # ls-ltr

Total 168

-rw-r--r-- 1 root root 5520 Dec 25 2014 install.log.syslog

-rw-r--r-- 1 root root 12754 Dec 25 2014 install.log

-rw- 1 root root 2005 Dec 25 2014 anaconda-ks.cfg

-rw-r--r-- 1 root root 12 Dec 9 21:11 a.txt

[root@VM_96_242_centos ~] # pwd

[root@VM_96_242_centos ~] # service mysqld start (note that this command is preceded by a space)

Then let's take a look at the history.

[root@VM_96_242_centos ~] # history | tail-3

844 2016-12-12 17:01:55 ls-ltr

845 2016-12-12 17:01:59 pwd

846 2016-12-12 17:02:36 history | tail-3

Did you find out that what we just implemented, service mysqld start is gone?

Note: if you don't want the history to remember which command, just add a space when executing the command. (enter before you start typing commands)

Of course, one day you want to clear all the history orders can be carried out:

[root@VM_96_242_centos ~] # history-c / / clear all records

[root@VM_96_242_centos ~] # history / / check whether it is emptied

1 2016-12-12 17:12:12 history

[root@VM_96_242_centos ~] #

At this point, the study of "how to hide History records in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Internet Technology

Wechat

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

12
Report