Skip to content

Commit

Permalink
update ssh install in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
freeliuzc committed Jun 29, 2022
1 parent 7a319b9 commit 14bad7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tekton/dockerfiles/Dockerfile.ocr
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ COPY ./Resource/sources.list /etc/apt/
COPY ./Resource/trusted.gpg /etc/apt/
COPY ./Resource/trusted.gpg.d /etc/apt/trusted.gpg.d
RUN apt-get update

RUN mkdir -p /var/run/sshd /root/.ssh
RUN /usr/sbin/sshd -p 22; if [ $? -ne 0 ]; then \
sh -c 'bin/echo -e "1" | apt-get install -y openssh-server'; fi
apt-get install -y openssh-server; fi

# disable UseDNS
RUN mkdir -p /var/run/sshd /root/.ssh
RUN sed -i "s/#UseDNS .*/UseDNS no/" /etc/ssh/sshd_config
RUN sed -i -r "s/^(.*pam_nologin.so)/#\1/" /etc/pam.d/sshd
RUN ssh-keygen -A
Expand Down

0 comments on commit 14bad7e

Please sign in to comment.