From a5ee0172919276b85e41e4a29466bc8042eb31b3 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 20 May 2026 20:23:49 +0200 Subject: [PATCH] homelab-mcp.service: SSH as root, the restricted shell is the boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unit was hard-coding HOMELAB_MCP_SSH_USER=mcp-reader, overriding the new code's 'root' default. No mcp-reader user exists on hubris — the key is authorized for root, with a strict command= wrapper. Also pin HOMELAB_MCP_HUBRIS_HOST + KNOWN_HOSTS env so the service doesn't depend on the python defaults staying in sync with the unit. Co-Authored-By: Claude Opus 4.7 (1M context) --- mcp/deploy/homelab-mcp.service | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mcp/deploy/homelab-mcp.service b/mcp/deploy/homelab-mcp.service index ad30b6c..6bb80ec 100644 --- a/mcp/deploy/homelab-mcp.service +++ b/mcp/deploy/homelab-mcp.service @@ -8,7 +8,12 @@ Type=simple WorkingDirectory=/opt/homelab-context Environment=HOMELAB_CONTEXT_DIR=/opt/homelab-context Environment=HOMELAB_MCP_SSH_KEY=/etc/homelab-mcp/mcp-reader.key -Environment=HOMELAB_MCP_SSH_USER=mcp-reader +# SSH user is `root` on hubris — the restricted shell at command="..." in +# authorized_keys (see mcp/mcp-reader-shell) provides the access boundary, +# not a separate user account. +Environment=HOMELAB_MCP_SSH_USER=root +Environment=HOMELAB_MCP_HUBRIS_HOST=192.168.8.77 +Environment=HOMELAB_MCP_SSH_KNOWN_HOSTS=/etc/homelab-mcp/known_hosts ExecStart=/opt/homelab-mcp/.venv/bin/python /opt/homelab-mcp/mcp/server.py Restart=on-failure RestartSec=5