Files
threshold/enos/modules/docker_openssh_server_ca_key/custom-cont-init.d/02-add-host-keys
T
Michael Li 1ba947d731 ce: Add infrastructure needed to test worker ssh known hosts (#6554)
(cherry picked from commit d022d7daf62623e5cca9c45cd234fd980d5baa9c)
2026-04-08 11:39:59 -04:00

16 lines
522 B
Plaintext

#!/usr/bin/with-contenv bash
# Copyright IBM Corp. 2020, 2025
# SPDX-License-Identifier: BUSL-1.1
chown 1000:1000 /etc/ssh/host-key
chmod 400 /etc/ssh/host-key
if ! grep -qE '^HostKey[[:space:]]+/etc/ssh/host-key$' /config/sshd/sshd_config 2>/dev/null; then
echo HostKey /etc/ssh/host-key >> /config/sshd/sshd_config
fi
if ! grep -qE '^HostCertificate[[:space:]]+/etc/ssh/host-key-cert.pub$' /config/sshd/sshd_config 2>/dev/null; then
echo HostCertificate /etc/ssh/host-key-cert.pub >> /config/sshd/sshd_config
fi