瀏覽代碼

sftp: Fix Host keys

multi_domain
ßingen 7 年之前
父節點
當前提交
5638f9cb22
共有 3 個檔案被更改,包括 8 行新增3 行删除
  1. +1
    -1
      images/sftp/Dockerfile
  2. +1
    -1
      images/sftp/Dockerfile.template
  3. +6
    -1
      images/sftp/docker-entrypoint.sh

+ 1
- 1
images/sftp/Dockerfile 查看文件

@@ -3,7 +3,7 @@ FROM debian:stretch
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openssh-server \
openssh-server openssl \
&& rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh

+ 1
- 1
images/sftp/Dockerfile.template 查看文件

@@ -3,7 +3,7 @@ FROM BASE_IMAGE_PLACEHOLDER
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openssh-server \
openssh-server openssl \
&& rm -rf /var/lib/apt/lists/*

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh

+ 6
- 1
images/sftp/docker-entrypoint.sh 查看文件

@@ -14,10 +14,15 @@ useradd -d ${PAPERLESS_CONSUMPTION_DIR} -p `openssl passwd -1 ${PAPERLESS_FTP_PW
chown ${PAPERLESS_FTP_USER} ${PAPERLESS_CONSUMPTION_DIR}
chmod 777 ${PAPERLESS_CONSUMPTION_DIR}

# Copy Server Public key if any (this is needed at least for Brother ADS-2400n)
# Copy Server Host key if any (this is needed at least for Brother ADS-2400n)
if [[ -s ${PAPERLESS_CONSUMPTION_DIR}/ssh_host_rsa_key.pub ]]; then
cp ${PAPERLESS_CONSUMPTION_DIR}/ssh_host_rsa_key.pub /etc/ssh/;
fi
if [[ -s ${PAPERLESS_CONSUMPTION_DIR}/ssh_host_rsa_key ]]; then
cp ${PAPERLESS_CONSUMPTION_DIR}/ssh_host_rsa_key /etc/ssh/;
fi
sed -i 's/#HostKey \/etc\/ssh\/ssh_host_rsa_key/HostKey \/etc\/ssh\/ssh_host_rsa_key/g' /etc/ssh/sshd_config
echo "HostKeyAlgorithms ssh-rsa" >> /etc/ssh/sshd_config

# https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/45234
mkdir -p /var/run/sshd

Loading…
取消
儲存