# RHEL-family test node WITH systemd as PID 1 (chlift's systemd path): Rocky Linux 9, sshd key auth only.
FROM rockylinux:9
RUN dnf install -y -q systemd openssh-server sudo procps-ng >/dev/null && dnf clean all >/dev/null \
 && sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/; s/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
 && mkdir -p /root/.ssh && chmod 700 /root/.ssh && systemctl enable sshd >/dev/null 2>&1
COPY authorized_keys /root/.ssh/authorized_keys
STOPSIGNAL SIGRTMIN+3
CMD ["/usr/sbin/init"]
