docker container run -it -d --name container-name nigamrout/ubuntu-ssh bash
10K+
FROM ubuntu as nigam-ssh
MAINTAINER Nigam Rout [email protected] LABEL maintainer="[email protected]"
RUN apt-get update -y
RUN apt-get install --no-install-recommends -y software-properties-common
RUN apt-get install openssh-server openssh-client -y
RUN apt-get update -y
RUN mkdir /var/run/sshd
RUN chmod 0755 /var/run/sshd
RUN useradd -m devops
RUN chmod -R 0700 /home/devops
RUN echo 'devops:devops123' | chpasswd
RUN whoami
USER devops
RUN whoami
RUN ssh-keygen -t rsa -f /home/devops/.ssh/id_rsa -P ""
RUN touch /home/devops/.ssh/authorized_keys
RUN cat /home/devops/.ssh/id_rsa.pub
USER root RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\srequired\spam_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
RUN ln -sf /usr/bin/python3.5 /usr/bin/python
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
Content type
Image
Digest
Size
98.4 MB
Last updated
over 8 years ago
docker pull nigamrout/ubuntu-ssh