Last active
August 29, 2015 14:14
-
-
Save ogavrisevs/6e244cd362e3136b7170 to your computer and use it in GitHub Desktop.
This file contains hidden or 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:6 | |
MAINTAINER Oskars G. | |
RUN yum -y install openssh-server | |
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key | |
RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key | |
RUN ssh-keygen -q -N "" -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key | |
RUN sed -i "s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config | |
RUN sed -i 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config | |
# create user with pass 'user' | |
RUN adduser user -p '$6$Yu.kO8se$BKxhp56L/gXYcWMNCsQT0sxeqnTYCzyuWcZfcfRxgf6Cad21yrebI6HWhon2u0VerklBg2o8HhG8yBbl0OBim/' | |
# add user to sudoers | |
RUN yum install sudo -y | |
RUN echo '%user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | |
EXPOSE 22 | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment