From 75f28f4ee14df32508306dcea57212b838fc72b6 Mon Sep 17 00:00:00 2001 From: trackers-love Date: Thu, 16 Jun 2022 19:27:31 +0800 Subject: [PATCH] benchmarks/system-configurations:4.66-ensure-system-histsize-as-100-or-other.md --- ...-ensure-system-histsize-as-100-or-other.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 benchmarks/system-configurations/4.66-ensure-system-histsize-as-100-or-other.md diff --git a/benchmarks/system-configurations/4.66-ensure-system-histsize-as-100-or-other.md b/benchmarks/system-configurations/4.66-ensure-system-histsize-as-100-or-other.md new file mode 100644 index 0000000..2907661 --- /dev/null +++ b/benchmarks/system-configurations/4.66-ensure-system-histsize-as-100-or-other.md @@ -0,0 +1,31 @@ +# 4.66 限制历史命令记录数量 + +## 安全等级 + +Level 1 + +## 描述 + +建议系统限制查看历史命令的数量,建议50或100(参考三级标准) + +## 修复建议 + +查看profile文件中环境变量HISTSIZE的值,运行以下命令设置历史命令记录数量为100并生效: + +```shell +# grep -qiP "^HISTSIZE" /etc/profile && sed -i "/^HISTSIZE/cHISTSIZE=100" /etc/profile || echo -e "HISTSIZE=100" >> /etc/profile +# source /etc/profile +``` + +## 扫描检测 + +查看HISTSIZE设置的值 + +```shell +#echo $HISTSIZE +100 +``` + +如果结果为100,则说明修复完成并通过检查。 + +## 参考 -- Gitee