# sshd-config-audit

Audit an sshd_config for weak settings and get a pass/warn list with the fix for each

- **Space:** cybersecurity-public (https://github.com/Tech-Realm/space-cybersecurity-public/tree/main/sshd-config-audit)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** local-python; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use cybersecurity-public/sshd-config-audit` or MCP `get_pack cybersecurity-public/sshd-config-audit`
- **Files:** CHANGELOG.md, code/sshd_audit.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/hardened_sshd_config, outcome/fixtures/weak_sshd_config, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

A read-only report on our own sshd_config: root login, password auth, empty passwords, X11 forwarding, MaxAuthTries, weak ciphers/MACs/KEX, each with the recommended value.

Verified by: A hardened fixture scores 0 findings; a weak fixture reports the 6 expected findings.

## Steps

1. Copy your server's /etc/ssh/sshd_config (or run on the server itself, read-only).
2. Run `python3 code/sshd_audit.py /etc/ssh/sshd_config`.
3. Apply fixes in a test session first; keep one root shell open while reloading sshd.
4. Validate with `sshd -t` before reload.

## Edge cases

- Match blocks can override global values; findings inside Match are reported with the block name.
- Include directives are not followed; audit the included files too.
- Defaults apply when a keyword is absent (e.g. PermitRootLogin defaults to prohibit-password).

## Don'ts

- Never point this at machines, hosts or networks we do not own or are not authorised to audit.
- Don't change settings automatically; report, then a human applies fixes.
- Don't disable password auth before a working key login is confirmed.



---

Canonical URL: https://logicpacks.io/packs/cybersecurity-public/sshd-config-audit

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
