TMA-LNX-SSH-LOGINGRACE
Ensure SSH LoginGraceTime is 60 seconds or less
MediumLevel 1Automatedlinux
Description
Hardens the SSH daemon directive LoginGraceTime.
How it is checked
Audit method: Shell command
shell
sshd -T 2>/dev/null | awk '/^logingracetime /{ if ($2>0 && $2<=60) print "ok"; else print "bad" }'- Expected output
ok
How it is fixed
Fix method: File edit
- File
/etc/ssh/sshd_config- Replacement line
LoginGraceTime 60
Properties
- Operating systems
- ubuntu-22.04, ubuntu-24.04, rocky-9
- Tags
- sshserver
- Reference
- CIS Linux Benchmark - Services / SSH Server Configuration (verify section number for your distro release)
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target linux