# # Copyright (C) 2019 XueTong Tech Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # FROM ubuntu:16.04 MAINTAINER xt COPY sources.list /etc/apt/sources.list RUN apt-get update \ && apt-get install -y bash git openssh-server rsync augeas-tools sudo iputils-ping net-tools curl vim \ && deluser $(getent passwd 33 | cut -d: -f1) \ && delgroup $(getent group 33 | cut -d: -f1) 2>/dev/null || true \ && mkdir -p ~root/.ssh /etc/authorized_keys && chmod 700 ~root/.ssh/ \ && augtool 'set /files/etc/ssh/sshd_config/AuthorizedKeysFile ".ssh/authorized_keys /etc/authorized_keys/%u"' \ && echo "Port 22\n" >> /etc/ssh/sshd_config \ && cp -a /etc/ssh /etc/ssh.cache \ && rm -rf /var/lib/apt/lists/* EXPOSE 22 COPY sshd_config /etc/ssh/sshd_config COPY entry.sh /entry.sh ENTRYPOINT ["/entry.sh"] CMD ["/usr/sbin/sshd", "-D", "-f", "/etc/ssh/sshd_config"]