Guest User

Untitled

a guest
Aug 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. FROM debian:latest
  2.  
  3. # Install packages
  4. RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
  5. openssh-server \
  6. apt-utils \
  7. python3\
  8. zip \
  9. unzip \
  10. sudo
  11.  
  12. RUN mkdir -p /var/run/sshd && sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config \
  13. && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
  14. && touch /root/.Xauthority \
  15. && true
  16.  
  17. ## Set a default user. Available via runtime flag `--user deploy`
  18. ## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library
  19. ## User should also have & own a home directory, but also be able to sudo
  20. RUN useradd deploy \
  21. && passwd -d deploy \
  22. && mkdir /home/deploy \
  23. && chown deploy:deploy /home/deploy \
  24. && addgroup deploy staff \
  25. && addgroup deploy sudo \
  26. && true
  27.  
  28. RUN mkdir -p /root/.ssh
  29. RUN echo "ssh-rsa <your-key-here>" >> /root/.ssh/authorized_keys
  30. RUN chmod 600 -R /root/.ssh
  31.  
  32. EXPOSE 22
Add Comment
Please, Sign In to add comment