FROM centos
RUN yum -y install openssh-server
RUN useradd user && \
echo "pass@321" | passwd user --stdin && \
mkdir /home/user/.ssh \
chmod 700 /home/user/.ssh
COPY remote-key.pub /home/user/.ssh/authorized_keys
RUN chown user:user -R /home/user/.ssh && \
chmod 600 /home/user/.ssh/authorized_keys
RUN /usr/sbin/sshd-keygen
CMD /usr/sbin/sshd -D
0 comments:
Post a Comment