TMAegisBeta
更多 linux 规则

Linux distributions

TMA-LNX-SSH-LOGINGRACE

Ensure SSH LoginGraceTime is 60 seconds or less

中级别 1自动化linux

说明

Hardens the SSH daemon directive LoginGraceTime.

检查方式

审计方法: Shell 命令

shell
sshd -T 2>/dev/null | awk '/^logingracetime /{ if ($2>0 && $2<=60) print "ok"; else print "bad" }'
预期输出
ok

修复方式

修复方法: 文件编辑

文件
/etc/ssh/sshd_config
替换行
LoginGraceTime 60

属性

操作系统
ubuntu-22.04, ubuntu-24.04, rocky-9
标签
sshserver
参考
CIS Linux Benchmark - Services / SSH Server Configuration (verify section number for your distro release)

检查本机

请在您有权审计的机器上运行此命令。扫描为只读操作。

shell
tmaegis scan --target linux