13 lines
534 B
Docker
13 lines
534 B
Docker
FROM ubuntu
|
|
RUN apt update
|
|
RUN apt install -y openssh-server
|
|
RUN mkdir /var/run/sshd
|
|
RUN echo 'root:password' | chpasswd
|
|
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
|
|
RUN sed -i 's/#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/' /etc/ssh/sshd_config
|
|
ADD authorized_keys /root/.ssh/authorized_keys
|
|
RUN chmod 600 /root/.ssh/authorized_keys
|
|
EXPOSE 22
|
|
CMD ["/usr/sbin/sshd", "-D"]
|