From f74ff2bdb748b11c26b2854b39e9d50c7f44e0b2 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 15 Feb 2019 15:56:06 -0800 Subject: [PATCH] Have gitea sshd listen on 222 This will allow us to use host networking since it won't conflict with existing services. Change-Id: Ie08d626508cd115561161ac1b60ced538a1c9c67 --- docker/gitea/Dockerfile | 2 ++ docker/gitea/sshd_config | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docker/gitea/sshd_config diff --git a/docker/gitea/Dockerfile b/docker/gitea/Dockerfile index b4c7909ddd..1ef879426a 100644 --- a/docker/gitea/Dockerfile +++ b/docker/gitea/Dockerfile @@ -70,6 +70,8 @@ RUN addgroup --system --gid 1000 git \ # Copy the /etc config files and entrypoint script COPY --from=build-env /go/src/code.gitea.io/gitea/docker / +# Copy our custom sshd_config +COPY sshd_config /etc/ssh/sshd_config # Copy the app COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea diff --git a/docker/gitea/sshd_config b/docker/gitea/sshd_config new file mode 100644 index 0000000000..5ae3a6b163 --- /dev/null +++ b/docker/gitea/sshd_config @@ -0,0 +1,33 @@ +Port 222 +Protocol 2 + +AddressFamily any +ListenAddress 0.0.0.0 +ListenAddress :: + +LogLevel INFO + +HostKey /data/ssh/ssh_host_ed25519_key +HostKey /data/ssh/ssh_host_rsa_key +HostKey /data/ssh/ssh_host_dsa_key +HostKey /data/ssh/ssh_host_ecdsa_key + +AuthorizedKeysFile .ssh/authorized_keys + +UseDNS no +AllowAgentForwarding no +AllowTcpForwarding no +PrintMotd no + +PermitUserEnvironment yes +PermitRootLogin no +ChallengeResponseAuthentication no +PasswordAuthentication no +PermitEmptyPasswords no + +AllowUsers git + +Banner none +Subsystem sftp /usr/lib/ssh/sftp-server + +AcceptEnv GIT_PROTOCOL