Debian GNU/Linux · Network

Disable SSH forwarding

When it fails: SSH sessions can forward ports, sockets, X11 and the SSH agent. Forwarding turns any SSH account into a tunnel through the firewall, in either direction.

CB-DEB-NET-018mediumactiveautomatedautomated fix, lockout riskprofile server-hardenedprofile desktop-hardened

As released in v0.1.0 beta · pre-release. Current state.

Description

DisableForwarding yes in the OpenSSH server turns off every kind of forwarding at once: TCP port forwarding (ssh -L, -R, -D), Unix socket forwarding, X11 forwarding and SSH agent forwarding, whatever the other *Forwarding options say.

Rationale

With forwarding, a user or an attacker holding any SSH account can open tunnels to internal services that the firewall does not expose, or expose the server's network to the outside (reverse tunnels). X11 and agent forwarding let a compromised server act on the client's display or reuse its keys.

Impact

Administrators lose ssh -L/-R/-D tunnels, ssh -A (agent forwarding, used to hop to other hosts or to git with the local key) and ssh -X. To reach other hosts, use ProxyJump (ssh -J) through a dedicated bastion instead of agent forwarding. Bastions need TCP forwarding for ProxyJump: exclude this control there, or allow it for a group of users with a Match Group block.

Applies when

Detected: when: OpenSSH server is installed A scanner reports the control not applicable when one is false.

Setting

Location/etc/ssh/sshd_config.d/00-cirsec.conf
Defaultno
Recommendedyes

Audit

Run sshd -T | grep '^disableforwarding '. It must print disableforwarding yes.

Automated: every check must pass. Scanners report each check by its id.

disable-forwarding

DisableForwarding.

key: disableforwarding
value: yes

Remediation

Add DisableForwarding yes to /etc/ssh/sshd_config.d/00-cirsec.conf, check with sshd -t, then run systemctl reload ssh.

Restartservice: ssh
Disruptionlow
Lockout riskyes: can cut off administrative access. Off by default in generated scripts and playbooks, opt in through a tailoring file.

Rollback

Remove the line and run systemctl reload ssh.

disable-forwarding

Generated from check disable-forwarding: the engine writes the fix for every output, it sets the expected value and the check runs again after.

Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelationNote
NIST SP 800-53 Rev. 55.1.1CM-7related
NIST SP 800-53 Rev. 55.1.1AC-17related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM 921, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Generated fix; SSH by key still accepted after the fix and after reboot.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM 931, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Generated fix; SSH by key still accepted after the fix and after reboot.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr