Created
June 20, 2013 11:26
-
-
Save naoya/5821987 to your computer and use it in GitHub Desktop.
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 centos | |
RUN yum install -y passwd | |
RUN yum install -y openssh | |
RUN yum install -y openssh-server | |
RUN yum install -y openssh-clients | |
RUN yum install -y sudo | |
## Install Chef Omnibus | |
# RUN curl -L http://www.opscode.com/chef/install.sh | bash | |
## create user | |
RUN useradd naoya | |
RUN passwd -f -u naoya | |
RUN mkdir -p /home/naoya/.ssh; chown naoya /home/naoya/.ssh; chmod 700 /home/naoya/.ssh | |
ADD ./authorized_keys /home/naoya/.ssh | |
RUN chown naoya /home/naoya/.ssh/authorized_keys; chmod 600 /home/naoya/.ssh/authorized_keys | |
## setup sudoers | |
RUN echo "naoya ALL=(ALL) ALL" >> /etc/sudoers.d/naoya | |
## setup sshd and generate ssh-keys by init script | |
ADD ./sshd_config /etc/ssh/sshd_config | |
RUN /etc/init.d/sshd start | |
RUN /etc/init.d/sshd stop | |
## Seems we cannnot fix private public port number | |
EXPOSE 22 | |
# EXPOSE 49222:22 | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment