Rewrite the host-access runbook for the installed model: ubuntu may sudo into the bot accounts and run the docs/backup allowlist but has no root; operator holds NOPASSWD:ALL via its own SSH key; root SSH stays closed. Record the closed backup root path, the silent watchdog, verification commands, safe-mode recovery, and rollback. Update the fleet and backup pages to match.
6.2 KiB
Agent host access
The agent host (ov-0f018e, an Infomaniak VPS Lite instance) separates three
levels of privilege: the bots, the steward, and the human operator.
The model
| Account | Role | Privilege |
|---|---|---|
socialbot, infrabot, designbot, future working-group bots |
agents | own Unix user, own gateway unit, no sudo at all |
ubuntu |
steward agent (Inferencebot) | may act inside the bot accounts and run the docs/backup service commands; no root |
operator |
human operator | own SSH key, full sudo (NOPASSWD:ALL); root SSH login stays closed |
The steward is the fleet administrator, not a root user. Root belongs to a
person: the operator signs in as operator with an SSH key and escalates
deliberately with sudo -i.
sudoers files
/etc/sudoers.d/91-bot-accessubuntu ALL=(socialbot,infrabot,designbot) NOPASSWD: ALL/etc/sudoers.d/90-inferencebot-restrictedubuntumay only start/stop/restartdocs-deploy-poll.serviceandagent-backup.service/.timer, and readdocs-deploy-polllogs./etc/sudoers.d/90-operatoroperator ALL=(ALL) NOPASSWD:ALL/etc/sudoers.d/90-<bot>-nosudo<bot> ALL=(ALL) !ALL— each bot is denied sudo, including via its own account.
Do not re-add the old cloud-init ubuntu ALL=(ALL) NOPASSWD:ALL rule. The
steward must not regain root, and the operator account is the root door.
No passwords
ubuntuand the bot accounts are password-locked (cloud imagelock_passwd: True); SSH password authentication is disabled (/etc/ssh/sshd_config.d/60-cloudimg-settings.conf).- Access is SSH public keys only. Do not set a password on
ubuntu, a bot, oroperatoras a convenience. operator's key is copied from/home/ubuntu/.ssh/authorized_keyswhen the account is created. If the operator's key rotates, update both/home/ubuntu/.ssh/authorized_keysand/home/operator/.ssh/authorized_keys.- Root SSH login is not authorized; do not add root authorized keys.
Root-owned execution paths
- Docs publisher.
/usr/local/sbin/docs-polland/usr/local/sbin/docs-publishare root-owned; the build runs asdocsbuildwith a scrubbed environment. - Nightly backup.
agent-backup.serviceruns as root withExecStart=/usr/local/sbin/agent-backup, a root-owned copy of~/.hermes/scripts/backup.sh. The source script stays editable byubuntu, but the unit executes the installed root-owned copy./usr/local/bin/resticisroot:root. - Backup credentials.
RESTIC_PASSWORD,RESTIC_REPOSITORY,SWB_S3_ACCESS_KEY,SWB_S3_SECRET_KEYlive only in root-only/etc/agent-backup.env(0600). The root script must not source/home/ubuntu/.hermes/.envand must not put/home/ubuntu/.local/binon itsPATH; either would make an agent-writable file a root code-execution path. - Watchdog.
check_root_trust.py(daily cron) stays silent when healthy and alerts if broad sudo returns,sudo -n truesucceeds, a root-executed binary is agent-owned, or a root script trusts agent files. It is silent as of 2026-11-21.
Any new root-executed script that reads an agent-writable file is a root path. Audit it before installing it as root code.
Verification
Run from an operator session:
# steward: bot access, no root
sudo -iu socialbot id # uid=1002
sudo -iu infrabot id # uid=1001
sudo -iu designbot id # uid=1003
sudo -n true # must fail: interactive authentication required
sudo -n /usr/bin/id # must fail
# operator: root door
sudo -n true && echo root-ok # root-ok
sudo -i
# root-trust watchdog: silence is the pass
python3 ~/.hermes/scripts/check_root_trust.py
Recovery when root is unreachable
If sudo policy or the operator key is wrong, or no in-band root remains, use the provider's rescue environment. On Infomaniak VPS Lite it is called Safe mode, not "Rescue".
-
Manager → VPS → the server → MANAGE → Restart the server (Safe mode). Services stop while it is booted.
-
Connect to the rescue image as user
infomaniak(temporary rescue password from the panel if SSH asks). The rescue image has a different host key, so use-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=nofor this session only. Thensudo -i; confirmid -uis0. -
Identify the disks with
lsblk -f. The rescue system is the first disk (root partition hostnameik-rescue). The cloud disk is the second disk; its root partition is labelledcloudimg-rootfs, usually/dev/sdb1. Mount it:mount /dev/sdb1 /mnt cat /mnt/etc/hostname # must print ov-0f018eIf it prints
ik-rescueor the file is missing, unmount and mount thecloudimg-rootfspartition instead. -
Run the staged recovery script, kept on the cloud disk:
less /mnt/home/ubuntu/recover.sh # inspect first bash /mnt/home/ubuntu/recover.shIt backs up the current sudoers files to
/mnt/root/pre-recovery-YYYYMMDD/, writes the bot-access and operator rules, ensures the operator user and key, closes the backup root path, and runsvisudo -c. Do not unmount/mntwhile it runs. -
umount /mnt, then MANAGE → Restart the server (Classic mode). -
Verify with the commands above. The normal SSH host key returns after the classic boot.
A narrative handoff of the same procedure, with no credentials, is kept at
/home/ubuntu/recovery-context.txt on the host.
Rollback
- Previous sudoers files:
/root/pre-recovery-YYYYMMDD/on the cloud disk. - Original cloud-init sudoers:
/root/sudoers-cloud-init.bak(0600). - Provider snapshots are the outer rollback.
- Restoring the broad cloud-init rule is not the intended end state; it is only a temporary recovery step while a narrower rule is installed.
Things not to do
- Do not restore
ubuntu ALL=(ALL) NOPASSWD:ALL. - Do not set a password on any account; keep access key-based.
- Do not use the backup unit's agent-owned binary,
PATH, or.envas a shortcut to root; that is the hole, not a recovery channel. - Do not run a root-owned unit against agent-writable files without a root-trust review.