Files
senior-kiosk/preseed-bootstrap.sh
T
jgitta 2431c6b6ae fix: enable root SSH login in preseed-bootstrap for debugging
Allows SSH as root during first-boot setup phase so we can run
commands without relying on the Proxmox console for paste.
install-kiosk.sh already disables this after kiosk setup completes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 00:36:02 +00:00

38 lines
1.2 KiB
Bash

#!/bin/bash
set -e
# Downloaded and run by the preseed late_command after Debian base install.
# Fetches install-kiosk.sh, configures getty@tty1 to auto-login as root,
# and runs the setup wizard automatically on first reboot.
REPO_BASE="https://gitea.jgitta.com/jgitta/senior-kiosk/raw/branch/master"
echo "==> SeniorNet: downloading setup script..."
curl -fsSL "$REPO_BASE/install-kiosk.sh" -o /usr/local/bin/kiosk-setup
chmod +x /usr/local/bin/kiosk-setup
echo "==> SeniorNet: configuring auto-login on TTY1..."
mkdir -p /etc/systemd/system/getty@tty1.service.d
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF'
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I $TERM
EOF
echo "==> SeniorNet: configuring setup to run on first login..."
cat >> /root/.bash_profile << 'EOF'
# SeniorNet first-boot setup — runs once then removes itself
if [ -x /usr/local/bin/kiosk-setup ]; then
/usr/local/bin/kiosk-setup
fi
EOF
# Allow root SSH login for debugging during setup
sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
# Boot to text mode for the setup wizard
systemctl set-default multi-user.target
echo "==> SeniorNet: ready. Setup wizard will run automatically on next reboot."