homelab-mcp.service: SSH as root, the restricted shell is the boundary
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user