Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. FROM centos
  2.  
  3.  
  4. RUN yum -y install openssh-server
  5.  
  6. RUN useradd remote_user && \
  7. echo "1234" | passwd remote_user --stdin && \
  8. mkdir /home/remote_user/.ssh && \
  9. chmod 700 /home/remote_user/.ssh
  10.  
  11. COPY remote-key.pub /home/remote_user/.ssh/authorized_keys
  12.  
  13. RUN chown remote_user:remote_user -R /home/remote_user/.ssh/ && \
  14. chmod 600 /home/remote_user/.ssh/authorized_keys
  15.  
  16. RUN /usr/sbin/sshd-keygen
  17.  
  18. CMD /usr/sbin/sshd -D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement