(options: SshHardeningOptions): string import {ssh_hardening} from '@fuzdev/zap/recipe_ssh.js'; Build the hardened sshd_config drop-in text for options.
The hardened baseline: root login disabled, password + keyboard-interactive
auth off, X11 forwarding off. Only AllowUsers and the tunables (max_auth_tries,
login_grace_time) come from inputs. It leaves UsePAM to the distro: Debian's and Ubuntu's stock
sshd_config sets it, and Alpine's sshd is built without PAM and warns on the
keyword; with password and keyboard-interactive auth off, PAM authenticates
nobody either way.
sshd keeps the first value it reads for most keywords, and the stock
sshd_config includes sshd_config.d/*.conf in name order before its own
lines. So name the drop-in to sort first (00-hardened.conf): a later drop-in,
such as a cloud image's 50-cloud-init.conf setting
PasswordAuthentication yes, then can't override it.
options
returns
string the complete drop-in text, terminated by a trailing newline.