Files
computer-playbook/roles/sys-svc-sshd/README.md
T
kevinveenbirkenbachandClaude Opus 4.7 16bdbf03d7 docs: fix repo-wide drift against documentation.md style rules
Three classes of drift cleaned up across 85 .md files:

- Em-dashes: replaced ` — ` with the contextually correct separator
  (colon for `term: explanation`, period to split clauses across
  sentences/source lines, parentheses for asides, semicolon for
  tight-linked continuations). Two intentional exceptions remain
  in `docs/contributing/documentation.md` (the rule literal) and
  inside a fenced ```sh block in `docs/contributing/actions/debugging/ci.md`.
- SPOT self-labels: rewrote "This is the SPOT for X" to describe
  the subject directly ("This directory holds X" / "This file
  describes X"). Cross-references to other artefacts' canonical
  role remain unchanged.
- Heading-emoji position: moved leading-emoji headings (`# 🧩 Title`)
  to trailing position (`# Title 🧩`) per the headline rule that
  emojis MUST come after the title text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 20:12:07 +02:00

2.0 KiB

sshd

Description

This Ansible role configures the OpenSSH daemon (sshd) by deploying a templated sshd_config file. It applies secure, best-practice settings to harden remote access and reduce the risk of misconfiguration or lockout. Settings include disabling root login, enforcing public-key authentication, and setting appropriate logging levels.

Overview

  • Renders sshd_config.j2 into /etc/ssh/sshd_config with customizable options
  • Sets file ownership (root:root) and permissions (0644)
  • Automatically reloads and restarts the SSH service via a systemd handler
  • Uses a run_once_sys_svc_sshd fact to ensure idempotent execution

Key variable: SYS_SVC_SSHD_PASSWORD_AUTHENTICATION (default: false) enables password authentication when explicitly required by controlled environments such as local E2E test targets.

Features

  • Templated Configuration: Delivers a Jinja2-based sshd_config with variables for debug logging, PAM support, and password-auth overrides.
  • Security Defaults: Disables password authentication and root login; enforces public-key authentication; conditionally sets LogLevel to DEBUG3 when MODE_DEBUG is true.
  • Systemd Integration: Handles daemon reload and service restart seamlessly on configuration changes.
  • Idempotency: Ensures tasks run only once per play by setting the run_once_sys_svc_sshd fact.

Further Resources

Credits

Developed and maintained by Kevin Veen-Birkenbach. Learn more at veen.world. Part of the Infinito.Nexus Project. Licensed under the Infinito.Nexus Community License (Non-Commercial).