docs: update the SSH_SERVER_HOST_KEYS default and generated keys (#566)

Since https://github.com/go-gitea/gitea/pull/33974 (1.27), `SSH_SERVER_HOST_KEYS` defaults to `ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa`. When none of the keys exist, Gitea generates 4096 bit RSA, 256 bit ECDSA and ED25519 keys instead of RSA alone. This updates next, 28 and 1.27 in all three languages, matching https://github.com/go-gitea/gitea/pull/39500.

Written by Claude.

Reviewed-on: https://gitea.com/gitea/docs/pulls/566
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: silverwind <[email protected]>
This commit is contained in:
silverwind
2026-09-30 23:34:35 +00:00
committed by silverwind
parent 7d9a82df8d
commit 4a0ef0480b
9 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -419,7 +419,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `SSH_SERVER_CIPHERS`: **`chacha20-poly1305@openssh.com`, `aes128-ctr`, `aes192-ctr`, `aes256-ctr`, `aes128-gcm@openssh.com`, `aes256-gcm@openssh.com`**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_MACS`: **`hmac-sha2-256-etm@openssh.com`, `hmac-sha2-256`, `hmac-sha1`**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If no key exists a 4096 bit RSA key will be created for you.
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If none of the keys exist, a 4096 bit RSA, a 256 bit ECDSA and an ED25519 key will be created for you.
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.
@@ -367,7 +367,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果不存在密钥,将为您创建一个 4096 位的 RSA 密钥。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果所有密钥都不存在,将为您创建 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密钥。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。
@@ -367,7 +367,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果不存在密钥,将为您创建一个 4096 位的 RSA 密钥。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果所有密钥都不存在,将为您创建 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密钥。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。
@@ -367,7 +367,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 对于内置的 SSH 服务器,选择支持的 SSH 连接的加密方法,对于系统 SSH,此设置无效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的密钥交换算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 对于内置 SSH 服务器,选择支持的 SSH 连接的 MAC 算法,对于系统 SSH,此设置无效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果不存在密钥,将为您创建一个 4096 位的 RSA 密钥。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 对于内置 SSH 服务器,选择要提供为主机密钥的密钥对。私钥应在 `SSH_SERVER_HOST_KEY` 中,公钥在 `SSH_SERVER_HOST_KEY.pub` 中。相对路径会相对于 `APP_DATA_PATH` 转为绝对路径。如果所有密钥都不存在,将为您创建 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密钥。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 测试公共 SSH 密钥时要在其中创建临时文件的目录,默认为系统临时目录。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密钥。该值将传递给 shell。默认情况下,Gitea 会自行进行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 启用将 SSH 克隆 URL 暴露给匿名访问者,默认为 false。
@@ -370,7 +370,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 對於內置的 SSH 伺服器,選擇支援的 SSH 連接的加密方法,對於系統 SSH,此設定無效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的密鑰交換算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的 MAC 算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果不存在密鑰,將為您建立一個 4096 位的 RSA 密鑰。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果所有密鑰都不存在,將為您建立 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密鑰。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 測試公共 SSH 密鑰時要在其中建立臨時文件的目錄,預設為系統臨時目錄。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密鑰。該值將傳遞給 shell。預設情況下,Gitea 會自行進行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 啟用將 SSH 克隆 URL 暴露給匿名訪問者,預設為 false。
@@ -370,7 +370,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 對於內置的 SSH 伺服器,選擇支援的 SSH 連接的加密方法,對於系統 SSH,此設定無效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的密鑰交換算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的 MAC 算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果不存在密鑰,將為您建立一個 4096 位的 RSA 密鑰。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果所有密鑰都不存在,將為您建立 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密鑰。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 測試公共 SSH 密鑰時要在其中建立臨時文件的目錄,預設為系統臨時目錄。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密鑰。該值將傳遞給 shell。預設情況下,Gitea 會自行進行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 啟用將 SSH 克隆 URL 暴露給匿名訪問者,預設為 false。
@@ -370,7 +370,7 @@ aliases:
- `SSH_SERVER_CIPHERS`: **[email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]**: 對於內置的 SSH 伺服器,選擇支援的 SSH 連接的加密方法,對於系統 SSH,此設定無效。
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的密鑰交換算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1**: 對於內置 SSH 伺服器,選擇支援的 SSH 連接的 MAC 算法,對於系統 SSH,此設定無效。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果不存在密鑰,將為您建立一個 4096 位的 RSA 密鑰。
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: 對於內置 SSH 伺服器,選擇要提供為主機密鑰的密鑰對。私鑰應在 `SSH_SERVER_HOST_KEY` 中,公鑰在 `SSH_SERVER_HOST_KEY.pub` 中。相對路徑會相對於 `APP_DATA_PATH` 轉為絕對路徑。如果所有密鑰都不存在,將為您建立 4096 位的 RSA、256 位的 ECDSA 和 ED25519 密鑰。
- `SSH_KEY_TEST_PATH`: **/tmp**: 在使用 `ssh-keygen` 測試公共 SSH 密鑰時要在其中建立臨時文件的目錄,預設為系統臨時目錄。
- `SSH_KEYGEN_PATH`: **_empty_**: 使用 `ssh-keygen` 解析公共 SSH 密鑰。該值將傳遞給 shell。預設情況下,Gitea 會自行進行解析。
- `SSH_EXPOSE_ANONYMOUS`: **false**: 啟用將 SSH 克隆 URL 暴露給匿名訪問者,預設為 false。
@@ -413,7 +413,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `SSH_SERVER_CIPHERS`: **`[email protected]`, `aes128-ctr`, `aes192-ctr`, `aes256-ctr`, `[email protected]`, `[email protected]`**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_MACS`: **`[email protected]`, `hmac-sha2-256`, `hmac-sha1`**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If no key exists a 4096 bit RSA key will be created for you.
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If none of the keys exist, a 4096 bit RSA, a 256 bit ECDSA and an ED25519 key will be created for you.
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.
@@ -419,7 +419,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
- `SSH_SERVER_CIPHERS`: **`[email protected]`, `aes128-ctr`, `aes192-ctr`, `aes256-ctr`, `[email protected]`, `[email protected]`**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_KEY_EXCHANGES`: **curve25519-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group14-sha256, diffie-hellman-group14-sha1**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
- `SSH_SERVER_MACS`: **`[email protected]`, `hmac-sha2-256`, `hmac-sha1`**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If no key exists a 4096 bit RSA key will be created for you.
- `SSH_SERVER_HOST_KEYS`: **ssh/gitea.rsa, ssh/gitea.ed25519, ssh/gitea.ecdsa, ssh/gogs.rsa**: For the built-in SSH server, choose the keypairs to offer as the host key. The private key should be at `SSH_SERVER_HOST_KEY` and the public `SSH_SERVER_HOST_KEY.pub`. Relative paths are made absolute relative to the `APP_DATA_PATH`. If none of the keys exist, a 4096 bit RSA, a 256 bit ECDSA and an ED25519 key will be created for you.
- `SSH_KEY_TEST_PATH`: **/tmp**: Directory to create temporary files in when testing public keys using ssh-keygen, default is the system temporary directory.
- `SSH_KEYGEN_PATH`: **_empty_**: Use `ssh-keygen` to parse public SSH keys. The value is passed to the shell. By default, Gitea does the parsing itself.
- `SSH_EXPOSE_ANONYMOUS`: **false**: Enable exposure of SSH clone URL to anonymous visitors, default is false.