TMAegisBeta
更多 macos 规则

macOS

TMA-MACOS-2.3.3.4

Ensure Remote Login Is Disabled

高级别 1自动化macos

说明

Remote Login allows an interactive terminal connection to a computer. Audit: All three benchmark checks must pass: systemsetup reports Off, sshd is disabled in launchd and not running.

检查方式

审计方法: Shell 命令

shell
a=$(/usr/sbin/systemsetup -getremotelogin 2>/dev/null) || exit 1
b=$(/bin/launchctl print-disabled system 2>/dev/null | /usr/bin/grep -c '"com.openssh.sshd" => disabled')
c=$(/bin/launchctl list 2>/dev/null | /usr/bin/grep -c "com.openssh.sshd")
if printf '%s' "$a" | /usr/bin/grep -q "Remote Login: Off" && [ "$b" -eq 1 ] && [ "$c" -eq 0 ]; then echo compliant; else echo "$a; disabled=$b; running=$c"; fi
预期输出
compliant

修复方式

修复方法: 操作指南或基础设施补丁

Terminal: sudo /usr/sbin/systemsetup -setremotelogin off. GUI: System Settings > General > Sharing > Set Remote Login to disabled.

属性

操作系统
macos-26
标签
macossystem-settings
参考
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 2.3.3.4 Ensure Remote Login Is Disabled

检查本机

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

shell
tmaegis scan --target macos