TMAegis
linux のその他のルール

CIS-UBUNTU-5.2.8

Ensure SSH root login is disabled

高レベル 1自動linux

説明

The PermitRootLogin parameter specifies if the root user can log in using ssh.

チェック方法

監査方法: ファイルパターン

ファイル
/etc/ssh/sshd_config
パターン
(?m)^\s*PermitRootLogin\s+no\b

修正方法

修正方法: シェルコマンド

shell
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config

プロパティ

オペレーティングシステム
ubuntu-22.04, ubuntu-24.04, rocky-9
タグ
sshserver
参照
CIS Ubuntu Linux / Rocky Linux Benchmarks - Ensure sshd PermitRootLogin is disabled (verify section number for your release)

このホストをチェック

監査が許可されているマシンで実行してください。スキャンは読み取り専用です。

shell
tmaegis scan --target linux