wupanhao / wupanhao.github.io

10 stars 3 forks source link

Docker Files #12

Open wupanhao opened 7 years ago

wupanhao commented 7 years ago

alpine:ssh

FROM alpine:latest
MAINTAINER ekinghao <ekinghao@gmail.com> 
RUN apk add --update openssh
# RUN apk add nginx
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa &&\
    echo "PermitRootLogin yes" >> /etc/ssh/sshd_config &&\
    echo "root:123456" | chpasswd
# RUN sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config
# EXPOSE 80
EXPOSE 22
# CMD ["nginx", "-g", "daemon off;"]
CMD ["/usr/sbin/sshd","-D"]