Table of Contents

Method StartSubsystemAsync

Namespace
SshSharp
Assembly
SshSharp.dll

StartSubsystemAsync(string, SshSessionOptions?, CancellationToken)

Starts a subsystem, as ssh -s does: a protocol the server runs by name (sftp, netconf, or one the server configures with sshd's Subsystem), with no shell in between. The session's StandardInput and StandardOutput carry the subsystem's protocol, byte for byte.

public Task<SshSession> StartSubsystemAsync(string name, SshSessionOptions? options = null, CancellationToken cancellationToken = default)

Parameters

name string

The subsystem's name, for example sftp.

options SshSessionOptions

Environment variables (and, rarely, a terminal) for the session.

cancellationToken CancellationToken

Cancels starting the subsystem.

Returns

Task<SshSession>

Exceptions

SshException

The server does not offer the subsystem (ChannelClosed), or the connection failed.