Files
CISS.debian.live.builder/config/includes.chroot/preseed/.ash/di_scripting_ssh.sh
Marc S. Weidner 60374476ab
Some checks failed
💙 Generating a PUBLIC Live ISO. / 💙 Generating a PUBLIC Live ISO. (push) Has been cancelled
🔐 Generating a Private Live ISO TRIXIE. / 🔐 Generating a Private Live ISO TRIXIE. (push) Has been cancelled
🛡️ Retrieve DNSSEC status of coresecret.dev. / 🛡️ Retrieve DNSSEC status of coresecret.dev. (push) Successful in 1m6s
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m47s
V8.13.512.2025.11.27
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
2025-11-27 08:26:12 +00:00

55 lines
1.9 KiB
Bash

#!/bin/sh
# bashsupport disable=BP5007
# shellcheck disable=SC2249
# shellcheck shell=sh
# SPDX-Version: 3.0
# SPDX-CreationInfo: 2025-05-05; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-ExternalRef: GIT https://git.coresecret.dev/msw/CISS.debian.live.builder.git
# SPDX-FileContributor: WEIDNER, Marc S.; Centurion Intelligence Consulting Agency
# SPDX-FileCopyrightText: 2024-2025; WEIDNER, Marc S.; <msw@coresecret.dev>
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: LicenseRef-CNCL-1.1 OR LicenseRef-CCLA-1.1
# SPDX-LicenseComment: This file is part of the CISS.debian.installer.secure framework.
# SPDX-PackageName: CISS.debian.live.builder
# SPDX-Security-Contact: security@coresecret.eu
# No bash in the installer environment, only BusyBox.
set -o errexit
set -o nounset
set -o noclobber
if [ ! -d /target/root/.ssh ]; then
mkdir -m 0700 /target/root/.ssh
fi
if [ -f /target/etc/ssh/ssh_host_ed25519_key ]; then
rm -f /target/etc/ssh/ssh_host_ed25519_key
fi
if [ -f /target/etc/ssh/ssh_host_rsa_key ]; then
rm -f /target/etc/ssh/ssh_host_rsa_key
fi
in-target ssh-keygen -o -a 1024 -N "" -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -C "root d-i $(date -I)"
in-target ssh-keygen -o -a 1024 -N "" -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -C "root d-i $(date -I)"
cp -a /target/etc/ssh/sshd_config /target/root/.d-i-backup/sshd_config.bak
rm -f /target/etc/ssh/sshd_config
cp /cdrom/install/.lib/sshd_config.lib /target/etc/ssh/sshd_config
chmod 0600 /target/etc/ssh/sshd_config
sed -i "s/Port 22/Port 37768/" /target/etc/ssh/sshd_config
sed -i "s/AllowUsers DUMMYSTRING/AllowUsers root/" /target/etc/ssh/sshd_config
cp /cdrom/install/.lib/banner.lib /target/etc/banner
chmod 0644 /target/etc/banner
umask 0077
wget --https-only --secure-protocol=TLSv1_3 -c -O /target/root/.ssh/authorized_keys https://coresecret.eu/download/developer/2024_rsa4096_developer_root.pub.key
exit 0
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh