Skip to content

Instantly share code, notes, and snippets.

@thestonefox
Created February 21, 2014 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thestonefox/9135218 to your computer and use it in GitHub Desktop.
Save thestonefox/9135218 to your computer and use it in GitHub Desktop.
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