Remote Login · macOS

On this page 7

Remote Login is the macOS sharing service that enables the built-in OpenSSH server on a Mac, so that authorized users can open a secure shell (SSH) session or transfer files with SFTP and scp from another computer. In macOS administration, it is the standard way to reach a Mac’s command line remotely for scripting, troubleshooting and maintenance without taking over the screen.

The switch lives in System Settings under General, then Sharing, and it is off by default. When it is turned on, macOS starts the sshd daemon through launchd and listens on TCP port 22, accepting connections only from accounts that the administrator permits.

How Remote Login runs the SSH service

Remote Login is a graphical control for the launchd job that runs OpenSSH, not a separate remote access product. Turning it on loads the com.openssh.sshd service, which launchd starts on demand for each incoming connection, so no idle daemon consumes resources while nobody is connected.

Access control relies on a hidden group named com.apple.access_ssh. When the administrator chooses Only these users in the Sharing pane, macOS adds the selected accounts to that group, and sshd refuses everyone else. Choosing All users removes the restriction, which is convenient but widens the attack surface.

The following table lists the main components involved when a client connects.

ComponentRoleLocation or name
sshd daemonHandles SSH connections/usr/sbin/sshd
launchd jobStarts sshd on demandcom.openssh.sshd
Server configurationDefines authentication and options/etc/ssh/sshd_config and its .d folder
Access groupLimits which accounts may log incom.apple.access_ssh
Host keysIdentify the Mac to clients/etc/ssh/ssh_host_* files
Components behind Remote Login

Ways to enable and check Remote Login

Administrators can enable Remote Login from System Settings, from Terminal or through device management. The Terminal method uses systemsetup, which in recent macOS versions requires Full Disk Access for the Terminal app or the management agent that runs it.

MethodCommand or pathTypical use
System SettingsGeneral, Sharing, Remote LoginSingle Mac at the desk
systemsetupsudo systemsetup -setremotelogin onScripts and local setup
Status checksudo systemsetup -getremoteloginAudits and compliance checks
MDM scriptScript deployed by the management serverFleets of managed Macs
launchctlLoad or unload the sshd jobTroubleshooting a stuck service
Methods for controlling Remote Login

The same settings apply on Intel and Apple silicon Macs, and the service behaves identically on desktops and laptops. On a portable Mac, however, the computer must be awake and connected to the network for a session to start, so administrators often pair Remote Login with wake for network access in the energy settings or schedule maintenance while the machine is plugged in.

Since macOS Ventura, the pane also offers Allow full disk access for remote users. Without it, an SSH session cannot read protected locations such as Mail data or other users’ Desktop folders, because privacy controls apply to the remote shell as they do to local apps.

Remote Login compared with other remote access services

macOS offers several remote services in the Sharing pane, and each one exposes a different layer of the system. Remote Login gives command-line access only, which makes it lightweight and precise but unsuitable for tasks that need the desktop.

ServiceWhat it providesProtocolBest fit
Remote LoginShell and file transferSSH on port 22Scripts and administration
Screen SharingView and control the desktopVNC-based, port 5900Helping a user visually
Remote ManagementApple Remote Desktop featuresARD protocolsManaging labs and groups
Remote Apple EventsScripting apps on the MacApple Events over networkAutomation between Macs
File SharingNetwork volumesSMBShared folders
Remote services in macOS Sharing

In managed environments, MDM handles most configuration through configuration profiles and declarative management, but Remote Login remains useful when a technician must inspect logs, run diagnostics or repair a management agent that is not responding.

Securing Remote Login on managed Macs

An open SSH service is a frequent target for password-guessing attacks, so Remote Login should be enabled only where it serves a clear purpose and restricted to named administrator accounts. Hardening focuses on authentication, network exposure and logging.

  • Use public key authentication and disable password logins in a drop-in file under /etc/ssh/sshd_config.d/.
  • Restrict access with Only these users rather than All users.
  • Keep port 22 unreachable from the internet, and require a VPN for off-site access.
  • Enable the application firewall and review unified logs for repeated failed logins.
  • Grant full disk access for remote users only when tasks truly require it.

Major macOS updates can replace the default sshd_config file, so custom settings belong in the .d drop-in folder, which survives system updates more reliably.

Common problems with Remote Login

Most connection failures come from network reachability, account restrictions or privacy controls rather than from a broken SSH server. The table maps typical symptoms to their causes.

SymptomLikely causeFix
Connection refusedRemote Login is offTurn it on in Sharing
Permission denied for a valid userUser not in the allowed listAdd the user under Only these users
Operation not permitted in some foldersMissing full disk accessEnable full disk access for remote users
systemsetup reports an errorTerminal lacks Full Disk AccessGrant access in Privacy and Security
Host key warning on the clientMac reinstalled or keys regeneratedVerify and update the known_hosts entry
Troubleshooting Remote Login

In everyday language

Remote Login is a switch that lets you control a Mac by typing commands from another computer. You do not see the Mac’s screen. You see a text window instead.

IT staff use it to fix problems without walking to the desk. Only people with an account and permission can connect. It is off unless someone turns it on. The key point is simple: turn it on only when needed, and allow only trusted accounts.

Seen in the real world

A university research lab runs 20 Mac mini computers that process microscope images overnight. The lab’s administrator enables Remote Login on each machine and limits access to two administrator accounts that sign in with SSH keys. Password logins are disabled in a drop-in configuration file, and the Macs are reachable only from the campus network.

One morning, the image pipeline on three machines has stopped. From an office laptop, the administrator connects over SSH, reads the job logs, finds that a disk is nearly full, deletes old temporary files and restarts the processing script with launchctl. The whole repair takes about 15 minutes, without visiting the server room or interrupting the other machines.