> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getprimo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SSH server

> Turn Remote Login on or off and set how the SSH server and client of your Macs authenticate, time out, greet and encrypt.

The SSH server control sets SSH on your Macs. Turn Remote Login, the Mac's SSH server, on or off, block root and password logins, show a banner before login, close idle connections, and restrict SSH to FIPS algorithms. Two settings apply to the SSH client employees run from the Mac.

## Platform compatibility

| macOS | Windows | Linux | iOS / iPadOS | Android |
| - | - | - | - | - |
| ✅ | | | | |

Requires macOS 15 or later.

## Set up the control

**1. Add a configuration**

Go to **MDM** > **Controls**, open **SSH server**, then click **Add configuration**.

**2. Configure the settings**

Set each setting you want to enforce. See the settings below. Configure at least one setting.

**3. Select targeting**

Choose which devices to apply the configuration to: all macOS devices, specific device groups, or a custom target. Click **Activate** to deploy the configuration. **Save** keeps it inactive.

A setting left empty or on **Not configured** isn't written: the Mac keeps its own setting.

## Settings

| Setting | Options |
| - | - |
| **Remote Login (SSH server)** | **On**, **Off**, **Not configured** |
| **Block root login over SSH** | **On**, **Not configured** |
| **Block password authentication over SSH** | **On**, **Not configured** |
| **Penalize addresses that fail to log in** | **On**, **Not configured** |
| **FIPS algorithms only (server and client)** | **On**, **Not configured** |
| **Banner shown before SSH login** | Up to 4000 characters |
| **Login time limit (seconds)** | 1 to 86400 |
| **Client check interval (seconds)** | 1 to 86400 |
| **Unanswered client checks before disconnecting** | 0 to 100 |
| **Inactive channel timeout (seconds)** | 1 to 86400 |
| **Unused connection timeout (seconds)** | 1 to 86400 |
| **SSH client: server check interval (seconds)** | 1 to 86400 |
| **SSH client: unanswered server checks before disconnecting** | 0 to 100 |

* **Remote Login (SSH server)** starts or stops the SSH server of the Mac. **Not configured** leaves it as it is.
* **Block password authentication over SSH** leaves key-based authentication as the only way to log in over SSH.
* **Penalize addresses that fail to log in** makes the Mac refuse connections for a while from an address that keeps failing to log in.
* **Banner shown before SSH login** is written to `/etc/banner` and shown before the password prompt.
* **Client check interval (seconds)** and **Unanswered client checks before disconnecting** close a connection whose client stops answering.
* **FIPS algorithms only (server and client)** and the two **SSH client** settings also apply to the connections employees open from the Mac.

## How it works

Primo runs a script on each Mac and checks the result with a policy. The script writes the SSH server and SSH client settings to files of its own in `/etc/ssh`, read before macOS's own settings so that they take precedence. It checks that SSH still reads its configuration before keeping them, and puts the previous files back otherwise. Each new SSH connection picks up the settings, with no restart.

The script saves the Mac's own Remote Login state and `/etc/banner` first. When a configuration stops managing them, or when you remove the control, Primo puts them back.

If someone edits Primo's files or adds an SSH configuration file that would take precedence, the policy fails and Primo runs the script again.

> [!WARNING]
>
> Before you turn **Remote Login (SSH server)** off or turn on **Block password
> authentication over SSH**, check that nobody relies on SSH to reach these
> Macs, such as a support tool or a build pipeline.

## Modify or remove the control

Open the control from **MDM > Controls** to edit, deactivate or replace the configuration.

## Related articles

* [Controls overview](https://docs.getprimo.com/mdm/policies/overview.md)
* [System services](https://docs.getprimo.com/mdm/policies/system-services.md)
* [Terminal security](https://docs.getprimo.com/mdm/policies/terminal-security.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.