sshd centos 8

This commit is contained in:
yangyu 2021-08-19 14:19:41 +08:00
parent 23cd5cd2ac
commit 1212ee1265

View File

@ -0,0 +1,16 @@
FROM centos:8
MAINTAINER Yang <yangyufans@qq.com>
RUN yum install -y passwd openssl openssh-server openssh-clients
RUN ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N '' && \
ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N '' && \
ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ''
RUN sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && \
sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config
RUN echo "123456" | passwd --stdin root
CMD ["/usr/sbin/sshd","-D"]