Merge pull request #69998 from rkachach/fix_issue_77991

qa/cephadm: fix hardcoded 'sshd' unit name in setup_ca_signed_keys

Reviewed-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
This commit is contained in:
Redouane Kachach 2026-07-09 15:44:02 +02:00 committed by GitHub
commit d899c9fd7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -628,12 +628,14 @@ def setup_ca_signed_keys(ctx, config):
'sudo', 'tee', '-a', '/etc/ssh/ca-key.pub',
])
# make sshd accept the CA signed key
# NOTE: the SSH server systemd unit is named 'ssh' on Debian/Ubuntu
# and 'sshd' on RHEL/CentOS/Rocky -- try both, but only after the
# config write itself has succeeded (grouped with parens so the
# restart fallback doesn't mask a failed config write).
remote.run(args=[
'sudo', 'echo', 'TrustedUserCAKeys /etc/ssh/ca-key.pub',
run.Raw('|'),
'sudo', 'tee', '-a', '/etc/ssh/sshd_config',
run.Raw('&&'),
'sudo', 'systemctl', 'restart', 'sshd',
'sudo', 'sh', '-c',
"echo 'TrustedUserCAKeys /etc/ssh/ca-key.pub' | sudo tee -a /etc/ssh/sshd_config && "
"(sudo systemctl restart ssh || sudo systemctl restart sshd)"
])
# generate a new key pair and sign the pub key to make a cert