Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Oskars Germovs <oskars_germovs@inbox.lv>
  • Loading branch information
Faks committed Mar 23, 2024
1 parent 9dddccb commit 01cbc27
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -436,27 +436,26 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \

ARG INSTALL_WORKSPACE_SSH=false

RUN mkdir -p /tmp/insecure_ssh_keys \
&& mkdir -p /tmp/secure_ssh_keys \
&& chmod 7777 /tmp/insecure_ssh_keys \
RUN mkdir -p /tmp/secure_ssh_keys \
&& chmod 7777 /tmp/secure_ssh_keys

COPY insecure_id_rsa /tmp/insecure_ssh_keys/insecure_id_rsa
COPY insecure_id_rsa.pub /tmp/insecure_ssh_keys/insecure_id_rsa.pub

COPY secure_ssh_keys/id_rsa /tmp/secure_ssh_keys/id_rsa
COPY secure_ssh_keys/id_rsa.pub /tmp/secure_ssh_keys/id_rsa.pub

COPY install_ssh_keys.sh /usr/local/bin/install_ssh_keys.sh
RUN mkdir -p /tmp/insecure_ssh_keys \
&& chmod 7777 /tmp/insecure_ssh_keys
COPY insecure_id_rsa /tmp/insecure_ssh_keys/id_rsa
COPY insecure_id_rsa.pub /tmp/insecure_ssh_keys/id_rsa.pub

COPY install_ssh_keys.sh /usr/local/bin/install_ssh_keys.sh
RUN chmod +x /usr/local/bin/install_ssh_keys.sh
RUN /usr/local/bin/install_ssh_keys.sh

RUN rm -rf /tmp/secure_ssh_keys && \
rm -rf /tmp/insecure_ssh_keys

RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \
&& rm -rf /tmp/secure_ssh_keys \
&& rm -rf /tmp/insecure_ssh_keys \
&& rm -f /etc/service/sshd/down \
&& cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
rm -f /etc/service/sshd/down && \
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
&& cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \
&& cat /tmp/id_rsa >> /root/.ssh/id_rsa \
&& rm -f /tmp/id_rsa* \
Expand Down

0 comments on commit 01cbc27

Please sign in to comment.