# A fresh server as a data center hands it over: Ubuntu 26.04, SSH, only root.
# Root logs in with a password (root) — no other user, no oosh.
FROM ubuntu:26.04

ENV WORKDIR /root/

WORKDIR $WORKDIR

# SSH server and what a rented server already has (curl, wget, certificates)
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends openssh-server curl wget ca-certificates && \
    mkdir -p /run/sshd && \
    ssh-keygen -A && \
    rm -rf /var/lib/apt/lists/*

# Only root: remove the default ubuntu user; root password = root
RUN userdel -r ubuntu 2>/dev/null; \
    echo 'root:root' | chpasswd

# Root may log in with a password, as on a fresh rented server
RUN printf '%s\n' 'PermitRootLogin yes' 'PasswordAuthentication yes' > /etc/ssh/sshd_config.d/10-root-login.conf

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]
