<PackageReference Include="SSH.NET" Version="2026.0.0" />

Renci.SshNet.ScpClient

public class ScpClient : BaseClient
Provides SCP client functionality.
public uint BufferSize { get; set; }

Gets or sets the size of the buffer.

public TimeSpan OperationTimeout { get; set; }

Gets or sets the operation timeout.

Gets or sets the transformation to apply to remote paths.

public bool UseDirectoryFlag { get; set; }

Gets or sets a value indicating whether the "-d" flag should be passed to the scp process on the server when uploading files. Defaults to true.

Occurs when downloading file.

Occurs when uploading file.

public ScpClient(ConnectionInfo connectionInfo, IRemotePathTransformation remotePathTransformation)

Initializes a new instance of the ScpClient class.

public ScpClient(string host, int port, string username, string password, IRemotePathTransformation remotePathTransformation)

Initializes a new instance of the ScpClient class.

public ScpClient(string host, string username, string password, IRemotePathTransformation remotePathTransformation)

Initializes a new instance of the ScpClient class.

public ScpClient(string host, int port, string username, IRemotePathTransformation remotePathTransformation, IPrivateKeySource[] keyFiles)

Initializes a new instance of the ScpClient class.

public ScpClient(string host, string username, IRemotePathTransformation remotePathTransformation, IPrivateKeySource[] keyFiles)

Initializes a new instance of the ScpClient class.

public ScpClient(ConnectionInfo connectionInfo)

public ScpClient(string host, int port, string username, string password)

public ScpClient(string host, string username, string password)

public ScpClient(string host, int port, string username, IPrivateKeySource[] keyFiles)

public ScpClient(string host, string username, IPrivateKeySource[] keyFiles)

public void Download(string filename, FileInfo fileInfo)

Downloads the specified file from the remote host to local file.

public void Download(string directoryName, DirectoryInfo directoryInfo)

Downloads the specified directory from the remote host to local directory.

public void Download(string filename, Stream destination)

Downloads the specified file from the remote host to the stream.

public void Upload(Stream source, string path)

Uploads the specified stream to the remote host.

public void Upload(FileInfo fileInfo, string path)

Uploads the specified file to the remote host.

public void Upload(DirectoryInfo directoryInfo, string path)

Uploads the specified directory to the remote host.