Table of Contents

Interface IRemotePathTransformation

Namespace
Renci.SshNet
Assembly
Renci.SshNet.dll

Represents a transformation that can be applied to a remote path.

public interface IRemotePathTransformation

Remarks

A remote path transformation is used by Renci.SshNet.ScpClient to encode a remote path before it is embedded in the scp command that is sent to the server. The correct transformation depends on the server: a shell-based server requires the path to be quoted or escaped according to its shell's rules, whereas a non-shell-based server uses the path literally and requires no transformation (see Renci.SshNet.RemotePathTransformation.None).

See Renci.SshNet.RemotePathTransformation for the implementations supplied with SSH.NET. On a shell-based server, choosing a transformation that does not match the shell can leave a crafted path able to execute as a command on the server; on a non-shell-based server, applying quoting or escaping corrupts the path. A transformation should therefore be selected deliberately for the target server and the trust placed in the supplied paths.

Methods

Transform(string)

Transforms the specified remote path.

string Transform(string path)

Parameters

path string

The path to transform.

Returns

string

The transformed path.

Exceptions

ArgumentNullException

path is null.