sshnet / sshnet/SSH.NET

RunCommand and "which"

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

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Hi,

When I use RunCommand, I notice it doesn't have the full path set up, compared with a normal SSH login. For example. it's missing /usr/local/bin. I can work around that (by using the full path) or use CreateShell.

However, I also notice which doesn't work. There's no error message but the exit code is 1 and there's no output.

I assume this is expected but can anyone explain what's happening?

Thanks!

Contributor guide

Open the contributing guide

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 RunCommand and CreateShell entry points and reproduce the which behavior while comparing the command environment and PATH. Done means determining whether the missing /usr/local/bin and exit code 1 are expected, then documenting or correcting the behavior based on that finding.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.