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 0000000000000000000000000000000000000000..290766112aa46a1a742e11c24dd084d55107601f --- /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,则说明修复完成并通过检查。 + +## 参考