Linux. bash_history today saw an article written by a person saying that it is dangerous to get the SSH private key through. bash_history. Www.2cto.com so what is the role of linux. bash_history? This is written on a blog: Bashshell in ~ /. Bash_history... linux. bash_history today I saw an article written by a person saying that it is dangerous to get the SSH private key through. bash_history. Www.2cto.com so what is the role of linux. bash_history? This is written on a blog: Bash shell in "~ /. Bash_history "(" ~ /"Indicates the user directory.) the file saves 500 used commands, which makes it easy to enter the used long commands. Each user with an account in the system has a ". bash_history" file in his Directory. In view of its danger, bash shell should save a small number of commands and delete these historical commands each time the user logs out. Step 1: The "HISTFILESIZE" and "HISTSIZE" lines in the "/etc/profile" file determine the number of old commands that can be saved in the ". bash_history" file for all users. We strongly recommend that you set the values of "HISTFILESIZE" and "HISTSIZE" in the "/etc/profile" file to a smaller number, such as 30. Edit the profile File (vi/etc/profile) and change the following line (some systems do not have it, just insert it): HISTFILESIZE = 30 HISTSIZE = 30 www.2cto.com, which indicates the ". the bash_history file can only save 30 old commands. Step 2: Add the following line "rm-f $ HOME/. bash_history" to the "/etc/skel/. bash_logout" file ". In this way, the ". bash_history" file will be deleted every time you log out.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service