Skip to content

Commit cbe42ce

Browse files
ManInDarkwxiaoguangGiteaBot
committed
bugfix check for alternate ssh host certificate location (go-gitea#34146)
fixes go-gitea#34145 Edited all locations to actually be correct. --------- Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 39b6abf commit cbe42ce

File tree

1 file changed

+9
-6
lines changed
  • docker/root/etc/s6/openssh

1 file changed

+9
-6
lines changed

docker/root/etc/s6/openssh/setup

+9-6
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@ if [ -e /data/ssh/ssh_host_ecdsa_cert ]; then
3131
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_cert"}
3232
fi
3333

34-
if [ -e /data/ssh/ssh_host_ed25519-cert.pub ]; then
35-
SSH_ED25519_CERT=${SSH_ED25519_CERT:-"/data/ssh/ssh_host_ed25519-cert.pub"}
34+
# In case someone wants to sign the `{keyname}.pub` key by `ssh-keygen -s ca -I identity ...` to
35+
# make use of the ssh-key certificate authority feature (see ssh-keygen CERTIFICATES section),
36+
# the generated key file name is `{keyname}-cert.pub`
37+
if [ -e /data/ssh/ssh_host_ed25519_key-cert.pub ]; then
38+
SSH_ED25519_CERT=${SSH_ED25519_CERT:-"/data/ssh/ssh_host_ed25519_key-cert.pub"}
3639
fi
3740

38-
if [ -e /data/ssh/ssh_host_rsa-cert.pub ]; then
39-
SSH_RSA_CERT=${SSH_RSA_CERT:-"/data/ssh/ssh_host_rsa-cert.pub"}
41+
if [ -e /data/ssh/ssh_host_rsa_key-cert.pub ]; then
42+
SSH_RSA_CERT=${SSH_RSA_CERT:-"/data/ssh/ssh_host_rsa_key-cert.pub"}
4043
fi
4144

42-
if [ -e /data/ssh/ssh_host_ecdsa-cert.pub ]; then
43-
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa-cert.pub"}
45+
if [ -e /data/ssh/ssh_host_ecdsa_key-cert.pub ]; then
46+
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_key-cert.pub"}
4447
fi
4548

4649
if [ -d /etc/ssh ]; then

0 commit comments

Comments
 (0)