BaselineWatch
Desk

system_settings_ssh_disable Disable SSH Server for Remote Access Sessions

NIST macOS Security Compliance Project Sequoia Guidance, Revision 4.0 (be5491f)
All changes in this version
first version loaded System Settings

Title

Disable SSH Server for Remote Access Sessions

Control

/bin/launchctl print-disabled system | /usr/bin/grep -c '"com.openssh.sshd" => disabled'

Discussion

SSH service _MUST_ be disabled for remote access.

Related controls

ac-17, cm-7, cm-7.1

Fix

[source,bash]
----
/usr/sbin/systemsetup -f -setremotelogin off >/dev/null
/bin/launchctl disable system/com.openssh.sshd
----
NOTE: Systemsetup with -setremotelogin flag will fail unless you grant Full Disk Access to systemsetup or its parent process. Requires supervision.