sshnet / sshnet/SSH.NET

Re-use SSH connection for SFTP

Open
#381 0 comments 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

Can I open a single SSH connection to run commands over, and have an SFTP session over the same connection, too? My application needs both and I don't like opening and authenticating two separate network connections to the same host for that.

I've tried to find out a bit about the inner workings of SSH but didn't get too far. I know that an SSH subsystem is just a server-side alias for a preconfigured command like "sftp-server". And I know that sftp-server speaks its own protocol to a client (albeit similar to the packet structure of SSH itself, which seems to cause performance issues due to double-encapsulation) over a "channel" (?) through the SSH connection. And I believe that there can be multiple channels in one SSH connection. That makes me wonder if there can be, say, a terminal and two SFTP sessions on a single SSH connection.

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 by reviewing the library's SSH connection and channel APIs, with attention to the SFTP session and terminal use cases described here. Determine whether one connection can support multiple channels and SFTP sessions, then document or expose a supported approach with coverage for the command, terminal, and two-SFTP-session scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.