OpenSSH V_9_9_P2 Repro Lab Alpine 3.21

Upstream OpenSSH 9.9p2 source build & account authentication state lab

Authentication & State Test Scenarios

# Reproduction Dockerfile: Upstream OpenSSH V_9_9_P2 on Alpine 3.21
FROM alpine:3.21

# Install build dependencies for compiling OpenSSH from source
RUN apk update && apk add --no-cache \
    build-base \
    openssl-dev \
    zlib-dev \
    linux-headers \
    git \
    autoreconf \
    autoconf \
    python3 \
    py3-pip \
    shadow \
    bash

# Clone upstream OpenSSH repository and checkout V_9_9_P2
WORKDIR /tmp
RUN git clone https://github.com/openssh/openssh-portable.git && \
    cd openssh-portable && \
    git checkout V_9_9_P2 && \
    autoreconf && \
    ./configure --prefix=/usr/local --sysconfdir=/etc/ssh && \
    make -j$(nproc) && \
    make install

# Configure privilege separation user and directory
RUN mkdir -p /var/empty && \
    addgroup -S sshd 2>/dev/null || true && \
    adduser -S -D -H -h /var/empty -s /sbin/nologin -G sshd sshd 2>/dev/null || true

# User Setup: Root is locked with '*' in /etc/shadow
RUN sed -i 's/^root:[^:]*:/root:*:/' /etc/shadow

# User Setup: Secondary user with active password hash
RUN adduser -D -s /bin/bash testuser && \
    echo "testuser:TestPass123!" | chpasswd

# Generate SSH host keys
RUN /usr/local/bin/ssh-keygen -A

# Copy sshd configuration
COPY sshd_config /etc/ssh/sshd_config

EXPOSE 22
CMD ["/usr/local/sbin/sshd", "-D", "-e"]
OpenSSH 9.9p2 Account State Notes

Accounts with a * hash in /etc/shadow represent locked accounts. In OpenSSH 9.9p2 built from upstream source, an initial authentication attempt against a locked account triggers PAM/shadow lookup paths that differentiate state between the initial attempt and subsequent attempts.

root@alpine-3-21:~#
CONTAINER IDLE
Alpine Linux 3.21 (OpenSSH V_9_9_P2 Upstream Repro Shell)
Click scenario buttons on the left or type commands below.
alpine-3-21 #
Cmds:
Notification