基线加固设置 ssh登录空闲超时登出TMOUT
检查方法:
cat /etc/profile |grep TMOUT
cat /etc/profile |grep export TMOUT
cat /etc/csh.cshrc |grep autologout
\#查看profile文件中TMOUT的值,该值的单位为秒,空闲超时登出。
加固步骤:
#备份文件
cp ‐p /etc/profile /etc/profile\_bak
cp ‐p /etc/csh.cshrc /etc/csh.cshrc\_bak
#修改文件
sed ‐i 's/TMOUT=0/TMOUT=300/g' /etc/profile
echo 'set autologout=30' >> /etc/csh.cshrc
readonly TMOUT \# 将值设置为readonly 防止用户更改。当前shell下是无法取消,修改需/etc/profile 注释readonly行
临时关闭:
unset TMOUT
还没有评论,来说两句吧...