Files
threshold/enos/modules/docker_openssh_server_ca_key/custom-cont-init.d/02-add-host-keys
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
522 B
Plaintext
Raw Normal View History

#!/usr/bin/with-contenv bash
# Copyright IBM Corp. 2020, 2026
# 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