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
namestringThe subsystem's name, for example
sftp.optionsSshSessionOptionsEnvironment variables (and, rarely, a terminal) for the session.
cancellationTokenCancellationTokenCancels starting the subsystem.
Returns
Exceptions
- SshException
The server does not offer the subsystem (ChannelClosed), or the connection failed.