Created
July 14, 2022 08:11
-
-
Save dadeba/736bb865c4e2e7716bb36d6676abc404 to your computer and use it in GitHub Desktop.
Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
# | |
RUN \ | |
apt-get update && \ | |
apt-get -y upgrade && \ | |
apt-get install -y build-essential && \ | |
apt-get install -y software-properties-common && \ | |
apt-get install -y curl git man unzip vim wget sudo zsh locales && \ | |
apt-get install -y net-tools iputils-ping emacs | |
# | |
RUN locale-gen en_US.UTF-8 | |
# | |
RUN useradd -m testuser | |
# | |
RUN gpasswd -a testuser sudo | |
# | |
RUN echo 'testuser:UnVhUeEK' | chpasswd | |
# | |
RUN sudo sed -i 's/testuser:x:1000:1000::\/home\/testuser:\/bin\/sh/testuser:x:1000:1000::\/home\/testuser:\/bin\/zsh/g' /etc/passwd | |
# | |
RUN apt install -y openssh-server | |
RUN mkdir /var/run/sshd | |
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config | |
# SSH login fix. Otherwise user is kicked off after login | |
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | |
ENV NOTVISIBLE "in users profile" | |
RUN echo "export VISIBLE=now" >> /etc/profile | |
EXPOSE 10022 | |
CMD ["/usr/sbin/sshd", "-D", "-p 10022"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment