Show fingerprint of the SSH host key #14884

Open
opened 2025-11-02 11:25:05 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @FranklinYu on GitHub (Aug 20, 2025).

Feature Description

GitLab automatically shows the fingerprint under path /help/instance_configuration#ssh-host-keys-fingerprints, such as this page on the official instance. It would be nice for Gitea to also publish this information automatically.

This is useful when connecting to Gitea the first time, and users will be prompted something like

The authenticity of host 'git.example.com (192.0.2.1)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'git.example.com' (ECDSA) to the list of known hosts

Right now users can only blindly trust it, leaving room for potentially MitM attack.

Screenshots

No response

Originally created by @FranklinYu on GitHub (Aug 20, 2025). ### Feature Description GitLab automatically shows the fingerprint under path `/help/instance_configuration#ssh-host-keys-fingerprints`, such as [this page on the official instance](https://gitlab.com/help/instance_configuration#ssh-host-keys-fingerprints). It would be nice for Gitea to also publish this information automatically. This is useful when connecting to Gitea the first time, and users will be prompted something like ```plain The authenticity of host 'git.example.com (192.0.2.1)' can't be established. ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'git.example.com' (ECDSA) to the list of known hosts ``` Right now users can only blindly trust it, leaving room for potentially MitM attack. ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 11:25:05 -06:00
Author
Owner

@FranklinYu commented on GitHub (Aug 20, 2025):

Since Gitea doesn’t bundle documentation into the installation, we might have to add a new route specific for this?

@FranklinYu commented on GitHub (Aug 20, 2025): Since Gitea doesn’t bundle documentation into the installation, we might have to add a new route specific for this?
Author
Owner

@izogfif commented on GitHub (Oct 31, 2025):

Meanwhile for Docker installation of Gitea (with default data paths) use this:

MSYS_NO_PATHCONV=1 DOCKER_CLI_HINTS=false docker exec -it 9d9b10b6c8a7 ssh-keygen -l -f /data/gitea/ssh/gitea.rsa.pub

replace 9d9b10b6c8a7 with container ID (obtainable via docker ps).
Note: I've added those variables at the start to avoid issues when running this command via Git Bash on Windows.

@izogfif commented on GitHub (Oct 31, 2025): Meanwhile for Docker installation of Gitea (with default data paths) use this: ```shell MSYS_NO_PATHCONV=1 DOCKER_CLI_HINTS=false docker exec -it 9d9b10b6c8a7 ssh-keygen -l -f /data/gitea/ssh/gitea.rsa.pub ``` replace `9d9b10b6c8a7` with container ID (obtainable via `docker ps`). Note: I've added those variables at the start to avoid issues when running this command via Git Bash on Windows.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14884