1 # Copyright (c) 2019 Erik Schilling
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # based on https://docs.docker.com/engine/examples/running_ssh_service/
19 RUN apt update && apt install -y net-tools iproute
20 RUN apt install -y openssh-server
21 RUN mkdir /var/run/sshd
22 RUN echo 'root:test' | chpasswd
23 RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
25 # SSH login fix. Otherwise user is kicked off after login
26 RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
28 ENV NOTVISIBLE "in users profile"
29 RUN echo "export VISIBLE=now" >> /etc/profile
33 CMD ["/usr/sbin/sshd", "-D"]