Skip to content

Commit

Permalink
update ssh install
Browse files Browse the repository at this point in the history
  • Loading branch information
freeliuzc committed Jun 30, 2022
1 parent ac8c30c commit 5f3cf61
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 17 deletions.
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.clas
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.detection
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.helix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
7 changes: 4 additions & 3 deletions tekton/dockerfiles/Dockerfile.rec
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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

# add tini
# ENV TINI_VERSION v0.19.0
# ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
Expand Down
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.science
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.seg
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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
6 changes: 4 additions & 2 deletions tekton/dockerfiles/Dockerfile.speech
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ 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 \
apt-get install -y openssh-server; fi
rm -rf /etc/ssh/sshd_config && 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 5f3cf61

Please sign in to comment.