Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh logs about missing host certificates #13724

Closed
42wim opened this issue Nov 27, 2020 · 8 comments · Fixed by #15849
Closed

ssh logs about missing host certificates #13724

42wim opened this issue Nov 27, 2020 · 8 comments · Fixed by #15849

Comments

@42wim
Copy link
Member

42wim commented Nov 27, 2020

  • Gitea version (or commit ref):
    7ec1c13 (release/v1.13)
  • Operating system:
    Self-build docker image

Description

Every ssh connection now logs

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

Introduced by #13143

Maybe make this opt-in?

@zeripath
Copy link
Contributor

So these are actually more warnings than errors and don't have any effect on the running of the sshd server. They simply mean that if the cert files exist they are used.

The alternative would mean that if you wanted to use a certificate you'd have to change the sshd.conf in addition to add them in. I guess it might be possible to generate the sshd.conf with a template and variables?

@42wim
Copy link
Member Author

42wim commented Nov 27, 2020

I'm personally going to add those to my gitea config, but could be annoying for users as it's filling logs with every connection (I'm running it behind a loadbalancer with a healthcheck).

Feel free to close also if not worth the effort.

@zeripath
Copy link
Contributor

I guess if you stuck some environment variable and template checks around

HostCertificate /data/ssh/ssh_host_ed25519_cert
and the other places it would work.

Wouldn't be too much work - only issue is I guess you would have to remember to change the file manually if you restarted the docker and wanted to add them in.

@joseluisq

This comment has been minimized.

@techknowlogick
Copy link
Member

@joseluisq the Could not load host certificate logs are warnings, and be safely ignored per above. The issue you are facing is Received signal 15; terminating. which means your binary is being OOM killed and is facing an unrelated issue to this one. Please hop into chat, or create a new forum thread and we can help walk you through finding out where all your memory went.

@joseluisq
Copy link

@joseluisq the Could not load host certificate logs are warnings, and be safely ignored per above. The issue you are facing is Received signal 15; terminating. which means your binary is being OOM killed and is facing an unrelated issue to this one. Please hop into chat, or create a new forum thread and we can help walk you through finding out where all your memory went.

@techknowlogick yeah I have realized after fix the issue because a bad Gitea config.

@toddnni
Copy link

toddnni commented May 10, 2021

A note. /etc/s6/openssh/setup inside the Docker image generates

ssh_host_dsa_key
ssh_host_dsa_key.pub
ssh_host_ecdsa_key
ssh_host_ecdsa_key.pub
ssh_host_ed25519_key
ssh_host_ed25519_key.pub
ssh_host_rsa_key
ssh_host_rsa_key.pub

So maybe the sshd_config template is just pointing to wrong files, eg. /data/ssh/ssh_host_ed25519_cert instead of /data/ssh/ssh_host_ed25519_key.pub.

SSH daemon seems to get the public keys from the private keys also, but prints warning on each connection.

@zeripath
Copy link
Contributor

No. Those are different things.

Just ignore the "errors" they're irrelevant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants