Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SSH Access For Docker
#Setup SSH Access
RUN apt-get -q -y update
RUN apt-get install -q -y openssl whois openssh-server vim nano
RUN mkdir -p /root/.ssh
RUN chown -R root:root /root/.ssh
RUN chmod -R 600 /root/.ssh/
RUN mkdir -p /var/run/sshd
RUN printf "#!/bin/bash \
\n echo \"root:password\" |chpasswd \
\n /usr/sbin/sshd -D" > /usr/local/bin/run
RUN chmod +x /usr/local/bin/run
CMD ["/usr/local/bin/run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment