docker image Could not load host certificate #6232

Closed
opened 2025-11-02 06:49:16 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @ghost on GitHub (Nov 1, 2020).

  • Gitea version (or commit ref): 1.14.0+dev-130-g543697e61
  • Git version:
  • Operating system:

I am using the latest docker image

Digest:sha256:08ec48ce917f718771f7f5a55fec0db03ab82a70d4da6240f5067951b5a7c276

  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

The ssh host keys cannot be loaded

server_1 | Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
server_1 | Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory
server_1 | Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory
server_1 | Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory

I moved the ssh directory and new ones were created but the newly created ones cannot be found either.

The sshd_config in the image points to the correct location and a ls command also finds them. Permissions seem to fine
The directory is owned by root

ls -la gitea/ssh
total 40
drwx------ 2 root root 4096 Nov 1 15:25 .
drwxr-xr-x 6 git git 4096 Nov 1 15:25 ..
-rw------- 1 root root 1381 Nov 1 15:25 ssh_host_dsa_key
-rw------- 1 root root 607 Nov 1 15:25 ssh_host_dsa_key.pub
-rw------- 1 root root 513 Nov 1 15:25 ssh_host_ecdsa_key
-rw------- 1 root root 179 Nov 1 15:25 ssh_host_ecdsa_key.pub
-rw------- 1 root root 411 Nov 1 15:25 ssh_host_ed25519_key
-rw------- 1 root root 99 Nov 1 15:25 ssh_host_ed25519_key.pub
-rw------- 1 root root 1823 Nov 1 15:25 ssh_host_rsa_key
-rw------- 1 root root 399 Nov 1 15:25 ssh_host_rsa_key.pub

I have not changed my config for gitea

grep -i ssh gitea/gitea/conf/app.ini
SSH_DOMAIN = git.domain.tld
DISABLE_SSH = false
SSH_PORT = 22
SSH_LISTEN_PORT = 22

Do I need another configuration now? I have seen the commit history for app.ini but I am not sure what is missing

Originally created by @ghost on GitHub (Nov 1, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.14.0+dev-130-g543697e61 - Git version: - Operating system: <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> I am using the latest docker image Digest:sha256:08ec48ce917f718771f7f5a55fec0db03ab82a70d4da6240f5067951b5a7c276 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description The ssh host keys cannot be loaded >server_1 | Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory server_1 | Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory server_1 | Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory server_1 | Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory I moved the ssh directory and new ones were created but the newly created ones cannot be found either. The sshd_config in the image points to the correct location and a ls command also finds them. Permissions seem to fine The directory is owned by root >ls -la gitea/ssh total 40 drwx------ 2 root root 4096 Nov 1 15:25 . drwxr-xr-x 6 git git 4096 Nov 1 15:25 .. -rw------- 1 root root 1381 Nov 1 15:25 ssh_host_dsa_key -rw------- 1 root root 607 Nov 1 15:25 ssh_host_dsa_key.pub -rw------- 1 root root 513 Nov 1 15:25 ssh_host_ecdsa_key -rw------- 1 root root 179 Nov 1 15:25 ssh_host_ecdsa_key.pub -rw------- 1 root root 411 Nov 1 15:25 ssh_host_ed25519_key -rw------- 1 root root 99 Nov 1 15:25 ssh_host_ed25519_key.pub -rw------- 1 root root 1823 Nov 1 15:25 ssh_host_rsa_key -rw------- 1 root root 399 Nov 1 15:25 ssh_host_rsa_key.pub I have not changed my config for gitea >grep -i ssh gitea/gitea/conf/app.ini SSH_DOMAIN = git.domain.tld DISABLE_SSH = false SSH_PORT = 22 SSH_LISTEN_PORT = 22 Do I need another configuration now? I have seen the commit history for app.ini but I am not sure what is missing
Author
Owner

@ghost commented on GitHub (Nov 1, 2020):

Ok. The "certs" are missing. I don't get it. For what is this used and how can I get rid of those lines? Which option do I have to use?

@ghost commented on GitHub (Nov 1, 2020): Ok. The "certs" are missing. I don't get it. For what is this used and how can I get rid of those lines? Which option do I have to use?
Author
Owner

@lunarys commented on GitHub (Nov 7, 2020):

Did you close the issue because you solved it? What did you do?
I'm having the same issue, though apart from those messages everything seems to be working normally.

@lunarys commented on GitHub (Nov 7, 2020): Did you close the issue because you solved it? What did you do? I'm having the same issue, though apart from those messages everything seems to be working normally.
Author
Owner

@zeripath commented on GitHub (Nov 7, 2020):

These log lines are simply warnings and can be ignored.

The lines are just in the sshd.conf to allow you to easily install host certificates if you want them

@zeripath commented on GitHub (Nov 7, 2020): # These log lines are simply warnings and can be ignored. # The lines are just in the sshd.conf to allow you to easily install host certificates if you want them
Author
Owner

@euh2 commented on GitHub (Nov 12, 2020):

I can't push through SSH anymore. Using rc2 now. Logs show Could not load host certificate "/data/ssh/ssh_host_dsa_cert". Shouldn't Gitea handle OpenSSH. I'm using the docker-image as well.

@euh2 commented on GitHub (Nov 12, 2020): I can't push through SSH anymore. Using rc2 now. Logs show `Could not load host certificate "/data/ssh/ssh_host_dsa_cert"`. Shouldn't Gitea handle OpenSSH. I'm using the docker-image as well.
Author
Owner

@zeripath commented on GitHub (Nov 12, 2020):

Those log lines are not relevant to your problem @euh2.

You should open a new issue - complete with logs and full information as to which docker version you are using and its configuration.

@zeripath commented on GitHub (Nov 12, 2020): Those log lines are not relevant to your problem @euh2. You should open a new issue - complete with logs and full information as to which docker version you are using and its configuration.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6232