main
1
2FROM ubuntu:20.04
3
4RUN apt-get update && apt-get install -y openssh-server
5
6RUN mkdir /var/run/sshd
7RUN echo 'root:boo' | chpasswd
8RUN sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
9
10# SSH login fix. Otherwise user is kicked off after login
11RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
12
13ENV NOTVISIBLE "in users profile"
14RUN echo "export VISIBLE=now" >> /etc/profile
15
16EXPOSE 22
17CMD ["/usr/sbin/sshd", "-D", "-e"]
18
19
20