You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/enos/modules/docker_openssh_server_ca_key/custom-cont-init.d/02-add-host-keys

16 lines
522 B

#!/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