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