Skip to content
Cryptography
ASD ISMISM-0484

ASD ISM 0484 Configure SSH for secure server access

What it says

The SSH daemon is configured to:

  • only listen on the required interfaces (ListenAddress xxx.xxx.xxx.xxx)
  • have a suitable login banner (Banner x)
  • have a login authentication timeout of no more than 60 seconds (LoginGraceTime 60)
  • disable host-based authentication (HostbasedAuthentication no)
  • disable rhosts-based authentication (IgnoreRhosts yes)
  • disable the ability to log in directly as root (PermitRootLogin no)
  • disable empty passwords (PermitEmptyPasswords no)
  • disable connection forwarding (AllowTCPForwarding no)
  • disable gateway ports (GatewayPorts no)
  • disable X11 forwarding (X11Forwarding no).

Quoted as published. Everything else on this page is written by Control Stack.

In plain English

Configure every SSH daemon with all ten listed settings, such as a login timeout of no more than 60 seconds, no direct root login and no connection or X11 forwarding.

Every SSH daemon (the server process that accepts SSH connections), whatever the software, must be configured to:

  • listen only on the interfaces that require SSH, and show a suitable login banner
  • allow no more than 60 seconds to authenticate before disconnecting
  • disable host-based and rhosts-based authentication, which let a trusted computer vouch for the user, plus direct root logins and empty passwords
  • disable connection forwarding (tunnelling connections through SSH), gateway ports (letting other computers use forwarded ports) and X11 forwarding (remote graphical display).

Why it matters

On default settings, many SSH daemons accept root logins by key and let any logged-on user tunnel traffic through the server into other networks. The ten settings shrink what the daemon exposes and what a stolen or misused account can do through it.

How to implement

  1. List every SSH daemon and the interfaces each one needs.

    Scan for SSH on all ports and compare the results with asset records, including network devices, appliances and management cards. Record which interfaces require SSH; where SSH is used to manage the equipment, treat it as a networked management interface, which ISM-2160 limits to a dedicated management network.

  2. Move administrators and automated jobs off direct root logins first.

    Each administrator logs in with the dedicated privileged account ISM-0445 requires and then elevates, so actions trace to a person (ISM-0414). Give jobs that log on as root, such as backup and configuration management tools, their own account. Confirm this works on each server before setting PermitRootLogin no.

  3. Apply all ten settings through a managed baseline.

    Do not trust defaults: the widely used open-source daemon allows root logins by key, connection forwarding and a 120-second login timeout, and LoginGraceTime 0 means no limit. Point Banner at a file holding the security responsibilities reminder ISM-0408 requires. Limit ciphers, key exchange, MACs and host keys to algorithms ISM-0471 allows.

  4. Check the settings each daemon really uses.

    Print the effective configuration with its test mode (sshd -T): drop-in files can override the main file, because the first value read wins, and some operating system builds ship X11 forwarding on. Test each Match block with its user and address (sshd -T -C) so none switches a setting back.

  5. Find equivalents on devices and services you cannot configure this way.

    For network devices and appliances, match each of the ten items to the vendor's settings; for a provider-run SSH service, ask the provider for its settings in writing. Where an item cannot be set, upgrade, replace or restrict access, and record a shortfall until it is fixed.

Keep it running

Recheck the effective settings after SSH or operating system upgrades and configuration management changes, because packages and cloud images can add drop-in files that override them. Apply the baseline to each new server or device before it goes live.

Evidence and audit

  1. Check 1 of 3What an auditor asks for

    Ask for

    The list of SSH daemons and a network scan for SSH on every port, run from each network segment.

    Look at

    Whether every host that answers SSH is on the list, and which of its interfaces answer.

    Good evidence

    Every SSH service the scan finds is on the list, including network devices and management cards, and none answers on an interface its system's records do not require.

  2. Check 2 of 3What an auditor asks for

    Ask for

    The effective configuration (sshd -T, or the vendor equivalent) from a sample of daemons drawn from the scan, with each Match block tested.

    Look at

    All ten settings, the banner text and any Match block that changes them.

    Good evidence

    Each sampled daemon listens only on required interfaces, shows a banner reminding users of their security responsibilities, has LoginGraceTime between 1 and 60, PermitRootLogin no rather than prohibit-password, and the other six settings exactly as listed, with no Match block reversing any of them.

  3. Check 3 of 3What an auditor asks for

    Ask for

    A live test against a sampled daemon using test accounts.

    Look at

    Whether it refuses a direct root login with a valid key, a logon to an account with an empty password, local and remote port forwards and X11 forwarding, and how long an unauthenticated connection stays open.

    Good evidence

    Every one of these attempts is refused, and an unauthenticated connection is closed within 60 seconds.

Mappings

Closest match in ISO/IEC 27001: A.5.15, Access control, which this control partially meets.

ISO 27001

ISO/IEC 27001: 4 mappings

  • A.5.15Access controlPartially meets
  • A.8.9Configuration managementPartially meets
  • A.8.20Networks securityPartially meets
  • A.8.5Secure authenticationPartially overlaps

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.