Initializes a new instance of the SshClient class.
Namespace: Renci.SshNetAssembly: Renci.SshNet (in Renci.SshNet.dll) Version: 0.1.0.0 (1.0.0.0)
Syntax
public SshClient( string host, string username, params PrivateKeyFile[] keyFiles )
Parameters
- host
- Type:
System String
Connection host.
- username
- Type:
System String
Authentication username.
- keyFiles
- Type: Renci.SshNet PrivateKeyFile
Authentication private key file(s) .
Exceptions
| Exception | Condition |
|---|---|
| keyFiles is null. | |
| host is invalid, -or- username is null or contains whitespace characters. |
Examples
using (var client = new SshClient(host, username, new PrivateKeyFile(keyFileStream))) { client.Connect(); client.Disconnect(); }
using (var client = new SshClient(host, username, new PrivateKeyFile(keyFileStream, passphrase))) { client.Connect(); client.Disconnect(); }
See Also