FROM python:3.9
ARG MAX_PKTSIZE=32768
RUN pip install 'asyncssh[bcrypt]' && \
    mkdir /root/.ssh && \
    chmod 700 /root/.ssh
COPY asyncsshd.py /
COPY ssh_host_rsa_key /etc/ssh/
COPY ssh_host_rsa_key.pub /etc/ssh/
COPY ssh_host_ecdsa256_key /etc/ssh/
COPY ssh_host_ecdsa256_key.pub /etc/ssh/
COPY ssh_host_ecdsa384_key /etc/ssh/
COPY ssh_host_ecdsa384_key.pub /etc/ssh/
COPY ssh_host_ecdsa521_key /etc/ssh/
COPY ssh_host_ecdsa521_key.pub /etc/ssh/
COPY ssh_host_ed25519_key /etc/ssh/
COPY ssh_host_ed25519_key.pub /etc/ssh/
COPY ssh_host_ed448_key /etc/ssh/
COPY ssh_host_ed448_key.pub /etc/ssh/
COPY ssh_host_dsa_key /etc/ssh/
COPY ssh_host_dsa_key.pub /etc/ssh/
COPY authorized_keys /root/.ssh/
RUN chmod 600 /etc/ssh/ssh_*_key /root/.ssh/authorized_keys
RUN passwd -u root
ENV MAX_PKTSIZE=${MAX_PKTSIZE}
ENTRYPOINT ["python", "/asyncsshd.py"]
