Bug 15066 - openssh: sshd_check_keys doesn't support config snippet
Summary: openssh: sshd_check_keys doesn't support config snippet
Status: RESOLVED WORKSFORME
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: connectivity (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.1
Assignee: New Comer Bugs
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2023-03-12 09:10 UTC by Fathi Boudra
Modified: 2026-03-21 21:22 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fathi Boudra 2023-03-12 09:10:02 UTC
the commit https://cgit.openembedded.org/openembedded-core/commit/meta/recipes-connectivity/openssh/openssh?id=70447c1680672bb4741a9e1c98aadc274e1ed5a0

added support for config snippet.

However, the script to generate keys https://cgit.openembedded.org/openembedded-core/tree/meta/recipes-connectivity/openssh/openssh/sshd_check_keys

doesn't support config snippet.

It contains support for sshd_config only.

To reproduce: add a config snippet with HostKey entry.
Result: only the HostKey entries from sshd_config are generated.
Expected result: HostKey entries from config snippet are generated.
Comment 1 Randy MacLeod 2023-03-16 14:37:15 UTC
Can you submit a patch to the email list?
Comment 2 Randy MacLeod 2023-03-16 14:37:30 UTC
See previous comment.
Comment 3 Fathi Boudra 2023-04-03 20:36:27 UTC
@Randy, it doesn't look like the bug needs more info.

> Can you submit a patch to the email list?

yes, I can have a look and propose a fix.

Set the status to accepted.
Comment 4 Randy MacLeod 2024-10-31 15:09:20 UTC
Bulk move of 5.1 bugs to 5.2. -- YP bug review (Randy)
Comment 5 Randy MacLeod 2025-06-05 16:55:13 UTC
Newcomer unless Fathi can find time and takes the bug back.
Comment 6 Randy MacLeod 2026-01-13 22:46:20 UTC
Fathi,

Can you check if this has been fixed 
or explain your steps in more detail for someone else to do that?

I haven't really looked but off-hand, I don't know what you mean by:
   "add a config snippet with HostKey entry."
Comment 7 Silviu Nicolae 2026-03-21 20:53:21 UTC
I don't see the issue with the sshd_check_keys script.
It seems to be working as intended for me. I created a config snippet in the location expected by the script, added a hostkey and at reboot the key was generated:

root@qemux86-64:/etc/ssh# cat sshd_config.d/test_key.conf
HostKey /etc/ssh/test_key_ed25519_key
root@qemux86-64:/etc/ssh# ls -al
total 624
drwxr-xr-x  3 root root   1024 Mar 21 20:14 .
drwxr-xr-x 38 root root   4096 Mar 21 20:09 ..
-rw-r--r--  1 root root 620105 Mar  9  2018 moduli
-rw-r--r--  1 root root   1569 Mar  9  2018 ssh_config
-rw-r--r--  1 root root   3202 Mar  9  2018 sshd_config
drwxr-xr-x  2 root root   1024 Mar 21 20:06 sshd_config.d
-rw-r--r--  1 root root   3211 Mar  9  2018 sshd_config_readonly
-rw-------  1 root root    411 Mar 21 20:14 test_key_ed25519_key
-rw-r--r--  1 root root     97 Mar 21 20:14 test_key_ed25519_key.pub
root@qemux86-64:/etc/ssh# file test_key_ed25519_key
test_key_ed25519_key: OpenSSH private key
root@qemux86-64:/etc/ssh# file test_key_ed25519_key.pub
test_key_ed25519_key.pub: OpenSSH ED25519 public key



I propose this ticket to be closed.
Comment 8 Paul Barker 2026-03-21 21:22:33 UTC
It looks like silviu is right, `sshd -G ...` in the sshd_check_keys script will dump the configuration including lines from config snippets. So I'll go ahead and close this.

Thanks silviu!