blob: cd6f6b1879dc884f69a9ddb0f95e42132deb4e5a [file] [log] [blame]
schillinge96221992019-03-14 22:41:52 +01001# Copyright (c) 2019 Erik Schilling
2# ALL RIGHTS RESERVED.
3#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15
16# based on https://docs.docker.com/engine/examples/running_ssh_service/
17FROM ubuntu:16.04
18
19RUN apt update && apt install -y net-tools iproute
20RUN apt install -y openssh-server
21RUN mkdir /var/run/sshd
22RUN echo 'root:test' | chpasswd
23RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
24
25# SSH login fix. Otherwise user is kicked off after login
26RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
27
28ENV NOTVISIBLE "in users profile"
29RUN echo "export VISIBLE=now" >> /etc/profile
30
31EXPOSE 22
32
33CMD ["/usr/sbin/sshd", "-D"]