from centos:7.5.1804
MAINTAINER weilizong
RUN yum clean all
RUN yum distro-sync -y
RUN yum update -y
RUN yum install -y openssl openssh-server sudo openssh-clients
RUN yum install -y vim net-tools passwd ntp ntpdate
RUN echo "root:root" | chpasswd
RUN echo "server 0.asia.pool.ntp.org">>/etc/ntp.conf
RUN echo "server 1.asia.pool.ntp.org">>/etc/ntp.conf
RUN echo "server 2.asia.pool.ntp.org">>/etc/ntp.conf
#RUN systemctl start ntpd
#RUN systemctl enable ntpd
#RUN ntpdate -d -b 192.168.85.20
RUN useradd anywhere
RUN echo "anywhere:anywhere" | chpasswd
RUN echo "anywhere ALL=(ALL) ALL">>/etc/sudoers
RUN ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
RUN ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
RUN cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
RUN echo y | cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN mkdir /var/run/sshd
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]