From 5e9be625ec3f592f198a15f9745bf0b819799dad Mon Sep 17 00:00:00 2001 From: Hermes Sysadmin Date: Fri, 20 Nov 2026 00:41:51 +0000 Subject: [PATCH] ssh-bridge 1.1.1: root-created /data/crontabs/bridge (busybox crontab not setuid); expose via /etc/crontabs + /var/spool/cron/crontabs symlinks --- ssh-bridge/config.yaml | 2 +- ssh-bridge/run.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ssh-bridge/config.yaml b/ssh-bridge/config.yaml index 62c65e5..c9582e8 100644 --- a/ssh-bridge/config.yaml +++ b/ssh-bridge/config.yaml @@ -1,5 +1,5 @@ name: "SSH Bridge (Tailscale)" -version: "1.1.0" +version: "1.1.1" slug: "ssh_bridge" description: "Contained tailscale+sshd fleet relay: jump host, SOCKS, tailnet DNS, persistent home, crond, git-over-ssh. Runs in its own network namespace; Home Assistant and the host itself do NOT join the tailnet." url: "https://git.halfast.com/hermes/ha-addons" diff --git a/ssh-bridge/run.sh b/ssh-bridge/run.sh index b4f3f72..5d3e9da 100755 --- a/ssh-bridge/run.sh +++ b/ssh-bridge/run.sh @@ -39,9 +39,17 @@ else echo "WARN: /share/ssh-bridge/tailscale_authkey missing; tailscale node not registered" fi -# --- busybox crond with a persistent crontab spool (user-owned crontabs, -# e.g. bridge's fleet supervise entry). -b daemonizes; logs to /data. +# --- busybox crond with a persistent crontab spool. +# busybox crontab(1) is not setuid, so the unprivileged bridge user cannot +# install its own crontab; create it here as root instead. The line is fixed +# forever — the script it runs lives in bridge's home and is freely editable. +cat > /data/crontabs/bridge <<'EOF' +* * * * * $HOME/.config/fleet/supervise.sh >/dev/null 2>&1 +EOF +chown bridge:bridge /data/crontabs/bridge +chmod 600 /data/crontabs/bridge ln -sfn /data/crontabs /var/spool/cron/crontabs +ln -sfn /data/crontabs /etc/crontabs crond -b -l 6 -L /data/cron.log # --- sshd host key (generated once, kept in /data; never regenerate —