Docker Dockerfile Ubuntusshd

Source: Internet
Author: User

#DockerfileFROM  ubuntu:14.04MAINTAINER gaogd<[email protected]>RUN rm -rf  /var/lib/apt/listsrun cp /etc/apt/sources.list /etc/apt/sources.list.bakadd   Sources.list /etc/apt/sources.listrun apt-get cleanrun apt-get updaterun apt-get  install -y  openjdk-7-jdkrun apt-get install -y openssh-serverrun  apt-get install -y vim tree lrzszRUN echo  ' root:[email protected ] '  |chpasswd RUN useradd -m ubuntu -s /bin/bashRUN echo  ' ubuntu:[ Email protected] " | chpasswdRUN echo " ubuntu   all= (All)         all " >> /etc/sudoersadd sshd_config /etc/ssh/sshd_ Configworkdir /home/ubuntu/user ubunturun pwd;ls -a; run mkdir /home/ubuntu /.sshrun ssh-keygen -t rsa -p  '  -f /home/ubuntu/.ssh/id_rsaadd authorized_keys /home/ubuntu/ . Ssh/authorized_keysuser rootrun chmod 600 /home/ubuntu/.ssh/authorized_keys ;chown  -R ubuntu.ubuntu /home/ubuntu/RUN mkdir /var/run/sshdRUN sed -ri  ' s/^ permitrootlogin\s+.*/permitrootlogin yes/'  /etc/ssh/sshd_configRUN sed -ri  ' s/usepam  yes/#UsePAM  yes/g '  /etc/ssh/sshd_configcmd ["/usr/sbin/sshd", "-D"]expose 4021





This article from the "Struggle Bar" blog, reproduced please contact the author!

Docker Dockerfile Ubuntusshd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.