Termix-SSH / Termix-SSH/Support

[BUG] cannot run cli command termix exec with connect permision

Open
#1,226 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug good-first-issue platform-linux platform-proxmox ssh
Dominant language
No language data
Stars
28
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Title

My user only have the connect permission to an host. It is authorizeto use termix ssh but not termix exec

Platform

CLI - Linux

Server Installation Method

Proxmox (Community Scripts)

Version

2.7.1

CLI Installation Method

npm

CLI Version

1.0.1

Troubleshooting
  • I have examined logs and tried to find the issue
  • I have reviewed opened and closed issues
  • I have tried restarting the application
  • I have checked open issues and ensured this is not a duplicate
The Problem

termix exec returns 404 Host not found for a non-admin user when the host is shared with connect permission. The same user can successfully connect to the same shared host with termix ssh .

This looks inconsistent with the documented behavior: termix exec is described as running one command on a host, while termix ssh opens an interactive terminal. If connect permission is enough to open an SSH session, it should also be enough to run a non-interactive SSH command.

The backend appears to reject shared hosts in the command execution path because it checks host ownership instead of shared host access.

How to Reproduce
  1. Create a host as an admin/owner and share it with a non-admin user using connect permission.
  2. Log in with the non-admin user via the Termix CLI.
  3. Run termix ssh and confirm it connects.
  4. Run termix exec uptime.
  5. Observe 404 Host not found.
Additional Context

An AI agent propose this:

The likely fix is to update the backend endpoint used by termix exec so it resolves hosts through the shared-host-aware resolver, same as interactive SSH.

Instead of resolving the host directly and requiring ownership:

  const host = await repository.findHostById(parseInt(hostId), userId);

  if (!host || host.userId !== userId) {
    return res.status(404).json({ error: "Host not found" });
  }

Use the normal shared-host resolver:

  const host = await resolveHostById(parseInt(hostId), userId);

  if (!host) {
    return res.status(404).json({ error: "Host not found" });
  }

This would allow termix exec to work for shared hosts with connect permission, matching termix ssh and the CLI documentation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the backend endpoint used by termix exec and compare its host lookup with the path used by termix ssh. Check the shown ownership-based lookup against resolveHostById, then reproduce with a shared host using connect permission and verify that termix exec <hostId> uptime succeeds without changing access for other users.

Written by the indexing model from the issue text.

Assessment

Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.