diff options
| -rw-r--r-- | meta/recipes-connectivity/openssh/openssh_9.7p1.bb | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh_9.7p1.bb b/meta/recipes-connectivity/openssh/openssh_9.7p1.bb index ab453f7bbe..0bc14c5553 100644 --- a/meta/recipes-connectivity/openssh/openssh_9.7p1.bb +++ b/meta/recipes-connectivity/openssh/openssh_9.7p1.bb | |||
| @@ -56,7 +56,7 @@ DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d) | |||
| 56 | 56 | ||
| 57 | # systemd-sshd-socket-mode means installing sshd.socket | 57 | # systemd-sshd-socket-mode means installing sshd.socket |
| 58 | # and systemd-sshd-service-mode corresponding to sshd.service | 58 | # and systemd-sshd-service-mode corresponding to sshd.service |
| 59 | PACKAGECONFIG ??= "systemd-sshd-socket-mode" | 59 | PACKAGECONFIG ??= "systemd-sshd-socket-mode hostkey-ecdsa" |
| 60 | PACKAGECONFIG[fido2] = "--with-security-key-builtin,--disable-security-key,libfido2" | 60 | PACKAGECONFIG[fido2] = "--with-security-key-builtin,--disable-security-key,libfido2" |
| 61 | PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" | 61 | PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" |
| 62 | PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" | 62 | PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" |
| @@ -64,6 +64,9 @@ PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" | |||
| 64 | PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" | 64 | PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" |
| 65 | PACKAGECONFIG[systemd-sshd-socket-mode] = "" | 65 | PACKAGECONFIG[systemd-sshd-socket-mode] = "" |
| 66 | PACKAGECONFIG[systemd-sshd-service-mode] = "" | 66 | PACKAGECONFIG[systemd-sshd-service-mode] = "" |
| 67 | PACKAGECONFIG[hostkey-rsa] = "" | ||
| 68 | PACKAGECONFIG[hostkey-ecdsa] = "" | ||
| 69 | PACKAGECONFIG[hostkey-ed25519] = "" | ||
| 67 | 70 | ||
| 68 | EXTRA_AUTORECONF += "--exclude=aclocal" | 71 | EXTRA_AUTORECONF += "--exclude=aclocal" |
| 69 | 72 | ||
| @@ -127,13 +130,31 @@ do_install:append () { | |||
| 127 | install -m 644 ${UNPACKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd | 130 | install -m 644 ${UNPACKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd |
| 128 | install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir} | 131 | install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir} |
| 129 | 132 | ||
| 133 | # Enable specific ssh host keys | ||
| 134 | sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config | ||
| 135 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-rsa','true','false',d)}; then | ||
| 136 | echo "HostKey /etc/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config | ||
| 137 | fi | ||
| 138 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-ecdsa','true','false',d)}; then | ||
| 139 | echo "HostKey /etc/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config | ||
| 140 | fi | ||
| 141 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-ed25519','true','false',d)}; then | ||
| 142 | echo "HostKey /etc/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config | ||
| 143 | fi | ||
| 144 | |||
| 130 | # Create config files for read-only rootfs | 145 | # Create config files for read-only rootfs |
| 131 | install -d ${D}${sysconfdir}/ssh | 146 | install -d ${D}${sysconfdir}/ssh |
| 132 | install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly | 147 | install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly |
| 133 | sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly | 148 | sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly |
| 134 | echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | 149 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-rsa','true','false',d)}; then |
| 135 | echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | 150 | echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly |
| 136 | echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | 151 | fi |
| 152 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-ecdsa','true','false',d)}; then | ||
| 153 | echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 154 | fi | ||
| 155 | if ${@bb.utils.contains('PACKAGECONFIG','hostkey-ed25519','true','false',d)}; then | ||
| 156 | echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly | ||
| 157 | fi | ||
| 137 | 158 | ||
| 138 | install -d ${D}${systemd_system_unitdir} | 159 | install -d ${D}${systemd_system_unitdir} |
| 139 | if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-socket-mode','true','false',d)}; then | 160 | if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-socket-mode','true','false',d)}; then |
