Files
ssh-netbox-wrapper/testenv/targets/target.Dockerfile
T
Sebi 87c3de540f
Test / test (pull_request) Successful in 4m6s
chore(deps): update alpine docker tag to v3.25
2026-12-04 02:51:14 +00:00

17 lines
651 B
Docker

# SSH target for the netssh test environment: every NetBox host, the bastion,
# and the static host run this image with a different hostname.
FROM alpine:3.25
# Alpine locks new accounts with "!"; sshd refuses key logins for locked
# accounts, so the password field is set to "*" (no password, not locked).
RUN apk add --no-cache openssh-server openssh-sftp-server python3 \
&& for user in ops admin; do \
adduser -D -s /bin/sh "$user" && sed -i "s/^$user:!/$user:*/" /etc/shadow; \
done
COPY testenv/targets/sshd_config /etc/ssh/sshd_config
COPY testenv/targets/entrypoint.sh /entrypoint.sh
EXPOSE 22 2222
ENTRYPOINT ["/entrypoint.sh"]