SshServerAuthMixin.get_ssh_server_auth() (new module ssh_server_auth.py): how an OpenSSH server lets people log in.
From sshd -T as root, the same fixed command OpenSshServerMixin plans its hardening on (SSHD_EFFECTIVE_COMMAND, now shared by both): password_authentication, kbd_interactive_authentication (before OpenSSH 8.7 also ChallengeResponseAuthentication), pubkey_authentication, hostbased_authentication, gssapi_authentication, authentication_methods as lists of methods (empty for any), permit_root_login, use_pam (None where sshd has no PAM, OpenBSD).
With UsePAM yes, pam_auth_stack: sshd's PAM auth stack, each module with its control and arguments, read as the login user from one fixed listing of /etc/pam.d (tail -n +1 -- /etc/pam.d/*) and followed through @include, include and substack (a loop or a missing file is skipped, an include naming a path is ignored). None when PAM is off or nothing for sshd could be read.
OpenSshServerMixin now inherits SshServerAuthMixin, so napalm-linux and its descendants (OMV, QNAP, Proxmox VE/PBS) get the getter with this release and no driver change.
Facts, not policy: whether a module is a second factor, or whether nullok lets a user through, is the consumer's call. Match blocks are not read (sshd -T without -C). A failed sshd -T raises RuntimeError.
Why
NetOrk/netork#662: NIS2 Art. 21(2)(j) MFA on the managed systems, judged from the SSH server's effective settings (decided there on 2026-11-07).
Tests
Fixtures only: the sshd -T and PAM texts are written after what OpenSSH 9.2p1 on Debian 12, Red Hat's password-auth layout and FreeBSD print, not recorded from a device. tests/test_ssh_server_auth.py: the parsers (every keyword, old ChallengeResponse keyword, no usepam, missing GSSAPI, not-sshd output, bracketed controls, paths, optional lines, invalid includes), the include walk (substack, loop, missing file), and the getter against a fake host (sshd -T once as root, PAM once without root, partial tail output, no PAM, failed read). 100 % coverage of the new module; ruff, mypy strict, napalm-standard check and ratchet green; the full suite passes.
Not tagged or released: the release is the coordinator's.
## What
`SshServerAuthMixin.get_ssh_server_auth()` (new module `ssh_server_auth.py`): how an OpenSSH server lets people log in.
- From `sshd -T` as root, the same fixed command `OpenSshServerMixin` plans its hardening on (`SSHD_EFFECTIVE_COMMAND`, now shared by both): `password_authentication`, `kbd_interactive_authentication` (before OpenSSH 8.7 also `ChallengeResponseAuthentication`), `pubkey_authentication`, `hostbased_authentication`, `gssapi_authentication`, `authentication_methods` as lists of methods (empty for `any`), `permit_root_login`, `use_pam` (None where sshd has no PAM, OpenBSD).
- With `UsePAM yes`, `pam_auth_stack`: sshd's PAM `auth` stack, each module with its control and arguments, read as the login user from one fixed listing of `/etc/pam.d` (`tail -n +1 -- /etc/pam.d/*`) and followed through `@include`, `include` and `substack` (a loop or a missing file is skipped, an include naming a path is ignored). None when PAM is off or nothing for sshd could be read.
- `OpenSshServerMixin` now inherits `SshServerAuthMixin`, so napalm-linux and its descendants (OMV, QNAP, Proxmox VE/PBS) get the getter with this release and no driver change.
Facts, not policy: whether a module is a second factor, or whether `nullok` lets a user through, is the consumer's call. `Match` blocks are not read (`sshd -T` without `-C`). A failed `sshd -T` raises `RuntimeError`.
## Why
NetOrk/netork#662: NIS2 Art. 21(2)(j) MFA on the managed systems, judged from the SSH server's effective settings (decided there on 2026-11-07).
## Tests
Fixtures only: the `sshd -T` and PAM texts are written after what OpenSSH 9.2p1 on Debian 12, Red Hat's `password-auth` layout and FreeBSD print, not recorded from a device. `tests/test_ssh_server_auth.py`: the parsers (every keyword, old ChallengeResponse keyword, no `usepam`, missing GSSAPI, not-sshd output, bracketed controls, paths, optional lines, invalid includes), the include walk (substack, loop, missing file), and the getter against a fake host (sshd -T once as root, PAM once without root, partial `tail` output, no PAM, failed read). 100 % coverage of the new module; ruff, mypy strict, `napalm-standard check` and `ratchet` green; the full suite passes.
Not tagged or released: the release is the coordinator's.
Refs NetOrk/netork#662
SshServerAuthMixin.get_ssh_server_auth() reads the authentication settings
from sshd -T as root (password, keyboard-interactive, public key, host-based,
GSSAPI, AuthenticationMethods, PermitRootLogin, UsePAM) and, with PAM on, the
modules of sshd's PAM auth stack from /etc/pam.d with its includes followed.
It reports the facts; whether a module is a second factor is the consumer's
call. OpenSshServerMixin carries it and both read sshd -T by the same fixed
command, so every driver that can harden sshd can say this too.
Refs NetOrk/netork#662
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
SshServerAuthMixin.get_ssh_server_auth()(new modulessh_server_auth.py): how an OpenSSH server lets people log in.sshd -Tas root, the same fixed commandOpenSshServerMixinplans its hardening on (SSHD_EFFECTIVE_COMMAND, now shared by both):password_authentication,kbd_interactive_authentication(before OpenSSH 8.7 alsoChallengeResponseAuthentication),pubkey_authentication,hostbased_authentication,gssapi_authentication,authentication_methodsas lists of methods (empty forany),permit_root_login,use_pam(None where sshd has no PAM, OpenBSD).UsePAM yes,pam_auth_stack: sshd's PAMauthstack, each module with its control and arguments, read as the login user from one fixed listing of/etc/pam.d(tail -n +1 -- /etc/pam.d/*) and followed through@include,includeandsubstack(a loop or a missing file is skipped, an include naming a path is ignored). None when PAM is off or nothing for sshd could be read.OpenSshServerMixinnow inheritsSshServerAuthMixin, so napalm-linux and its descendants (OMV, QNAP, Proxmox VE/PBS) get the getter with this release and no driver change.Facts, not policy: whether a module is a second factor, or whether
nulloklets a user through, is the consumer's call.Matchblocks are not read (sshd -Twithout-C). A failedsshd -TraisesRuntimeError.Why
NetOrk/netork#662: NIS2 Art. 21(2)(j) MFA on the managed systems, judged from the SSH server's effective settings (decided there on 2026-11-07).
Tests
Fixtures only: the
sshd -Tand PAM texts are written after what OpenSSH 9.2p1 on Debian 12, Red Hat'spassword-authlayout and FreeBSD print, not recorded from a device.tests/test_ssh_server_auth.py: the parsers (every keyword, old ChallengeResponse keyword, nousepam, missing GSSAPI, not-sshd output, bracketed controls, paths, optional lines, invalid includes), the include walk (substack, loop, missing file), and the getter against a fake host (sshd -T once as root, PAM once without root, partialtailoutput, no PAM, failed read). 100 % coverage of the new module; ruff, mypy strict,napalm-standard checkandratchetgreen; the full suite passes.Not tagged or released: the release is the coordinator's.
Refs NetOrk/netork#662