2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-09 22:46:45 +00:00
Files
confluent/confluent_osdeploy/suse16/profiles/server/scripts/prechroot.sh
T
Markus Hilger 737c761be2 Set up hostbased ssh on installed SUSE 16 systems
prechroot.sh had setupssh.sh commented out and copied only the keys
inline, so nodes came up without shosts.equiv, without the CA in
ssh_known_hosts and without a setuid ssh-keysign.
2026-09-07 06:14:54 +02:00

39 lines
1.4 KiB
Bash

#!/bin/sh
# This script runs when install is finished, but while the installer
# is still running, with the to-be-booted system mounted in /mnt
# carry over deployment configuration and api key for OS install action
confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg|sed -e 's/^profile: //')
nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}')
export confluent_profile nodename
mkdir -p /mnt/etc/confluent
chmod 700 /mnt/etc/confluent
cp /etc/confluent/functions /mnt/etc/confluent/
. /etc/confluent/functions
cp -a /etc/confluent/* /mnt/etc/confluent/
cp -a /etc/confluent/tls/* /mnt/var/lib/ca-certificates/openssl
cp -a /etc/confluent/tls/* /mnt/var/lib/ca-certificates/pem
cp -a /etc/confluent/tls/*.pem /mnt/etc/pki/trust/anchors
cat /etc/confluent/tls/*.pem > /mnt/etc/confluent/ca.pem
mkdir -p /mnt/opt/confluent/bin
cp /opt/confluent/bin/apiclient /mnt/opt/confluent/bin/
instnmcfg=/run/NetworkManager/system-connections/$(cat /run/confluent/ifname).nmconnection
if [ -e "$instnmcfg" ]; then
cp $instnmcfg /mnt/etc/NetworkManager/system-connections/
fi
run_remote setupssh.sh
echo Port 22 >> /etc/ssh/sshd_config.d/00-chroot.conf
echo Port 2222 >> /etc/ssh/sshd_config.d/00-chroot.conf
echo Match LocalPort 22 >> /etc/ssh/sshd_config.d/00-chroot.conf
echo " ChrootDirectory /mnt" >> /etc/ssh/sshd_config.d/00-chroot.conf
systemctl restart sshd
mkdir -p /mnt/var/log/confluent
cp /tmp/confluent*log /mnt/var/log/confluent