From 49717d5b385aba1747961e3f9d5af46efda0afba Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Tue, 12 Mar 2024 10:31:30 -0500 Subject: [PATCH 1/2] fix sshd-keygen command location for amz linux 2023 --- recipes/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index 13e78be8..165cfd23 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -60,12 +60,12 @@ def listen_addr_for(interface, type) # this will only execute on RHEL / Fedora systems where sshd has never been started # 99.99% of the time this is going to be a docker container if keygen_platform? && sshd_host_keys_missing? - if platform_family?('fedora', 'rhel') && node['platform_version'].to_i >= 8 # fedora and RHEL 8+ + if platform_family?('fedora', 'rhel', 'amazon') && node['platform_version'].to_i >= 8 # fedora, RHEL 8+, Amazonlinux 2023+ node['openssh']['server']['host_key'].each do |key| keytype = key.split('_')[-2] execute "/usr/libexec/openssh/sshd-keygen #{keytype}" end - elsif platform_family?('rhel', 'amazon') # RHEL < 8 or Amazon Linux + elsif platform_family?('rhel', 'amazon') # RHEL < 8 or Amazon Linux 2 execute '/usr/sbin/sshd-keygen' elsif platform_family?('suse') execute '/usr/sbin/sshd-gen-keys-start' From 12f5fa79115cfc3687682e2f30500514fffad19c Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Tue, 12 Mar 2024 10:48:49 -0500 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 423f9b3a..6ba26583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the openssh cookbook. ## Unreleased +- fix sshd-keygen command location for Amazon Linux 2023 + ## 2.11.6 - *2023-12-21* ## 2.11.5 - *2023-09-29*