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