TMAegis
ros 관련 규칙 더 보기

TMA-ROS1-5.2.10

Ensure SSH root login is disabled

높음레벨 1자동ros

설명

The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no. The audit requires PermitRootLogin no. The audit reads the effective sshd configuration (sshd -T, root). Host-level control from the CIS ROS Melodic benchmark (Ubuntu 18.04 robot hosts); run as root.

점검 방법

감사 방식: 셸 명령

shell
command -v sshd >/dev/null 2>&1 || exit 1
out=$(sshd -T -C user=root -C host="$(hostname)" -C addr="$(hostname -I 2>/dev/null | cut -d' ' -f1)" 2>/dev/null) || out=$(sshd -T 2>/dev/null) || exit 1
v=$(printf '%s\n' "$out" | awk 'tolower($1)=="permitrootlogin"{print tolower($2); exit}')
case "$v" in no) echo compliant ;; *) echo "PermitRootLogin ${v:-unset}" ;; esac
예상 출력
compliant

조치 방법

조치 방식: 가이드 또는 인프라 패치

Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no

속성

운영 체제
모두
태그
rosros1melodicaccess-control
참고 자료
CIS ROS Melodic Benchmark v1.0.0 - 5.2.10 Ensure SSH root login is disabled

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target ros