bugfix check for alternate ssh host certificate location (#34146) (#34166)

Backport #34146 by ManInDark

fixes #34145

Edited all locations to actually be correct.

Co-authored-by: ManInDark <61268856+ManInDark@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2025-04-10 12:00:43 +08:00
committed by GitHub
parent 39b6abf955
commit 328ce0485f

View File

@ -31,16 +31,19 @@ if [ -e /data/ssh/ssh_host_ecdsa_cert ]; then
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_cert"} SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_cert"}
fi fi
if [ -e /data/ssh/ssh_host_ed25519-cert.pub ]; then # In case someone wants to sign the `{keyname}.pub` key by `ssh-keygen -s ca -I identity ...` to
SSH_ED25519_CERT=${SSH_ED25519_CERT:-"/data/ssh/ssh_host_ed25519-cert.pub"} # make use of the ssh-key certificate authority feature (see ssh-keygen CERTIFICATES section),
# the generated key file name is `{keyname}-cert.pub`
if [ -e /data/ssh/ssh_host_ed25519_key-cert.pub ]; then
SSH_ED25519_CERT=${SSH_ED25519_CERT:-"/data/ssh/ssh_host_ed25519_key-cert.pub"}
fi fi
if [ -e /data/ssh/ssh_host_rsa-cert.pub ]; then if [ -e /data/ssh/ssh_host_rsa_key-cert.pub ]; then
SSH_RSA_CERT=${SSH_RSA_CERT:-"/data/ssh/ssh_host_rsa-cert.pub"} SSH_RSA_CERT=${SSH_RSA_CERT:-"/data/ssh/ssh_host_rsa_key-cert.pub"}
fi fi
if [ -e /data/ssh/ssh_host_ecdsa-cert.pub ]; then if [ -e /data/ssh/ssh_host_ecdsa_key-cert.pub ]; then
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa-cert.pub"} SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_key-cert.pub"}
fi fi
if [ -d /etc/ssh ]; then if [ -d /etc/ssh ]; then