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

What is the way to force history not to remember sensitive commands

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

Share

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

Force history not to remember sensitive commands what is the method, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

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.

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

After reading the above, have you mastered the method of forcing history not to remember sensitive commands? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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