Provides connection information when password authentication method is used
Inheritance Hierarchy
Renci.SshNet ConnectionInfo
Renci.SshNet PasswordConnectionInfo
Namespace: Renci.SshNet
Assembly: Renci.SshNet (in Renci.SshNet.dll) Version: 0.1.0.0 (1.0.0.0)
Syntax
public class PasswordConnectionInfo : ConnectionInfo, IDisposable
Examples
var connectionInfo = new PasswordConnectionInfo(host, username, password); using (var client = new SftpClient(connectionInfo)) { client.Connect(); // Do something here client.Disconnect(); }
var connectionInfo = new PasswordConnectionInfo("host", "username", "password"); var encoding = new Renci.SshNet.Common.ASCIIEncoding(); connectionInfo.PasswordExpired += delegate(object sender, AuthenticationPasswordChangeEventArgs e) { e.NewPassword = encoding.GetBytes("123456"); }; using (var client = new SshClient(connectionInfo)) { client.Connect(); client.Disconnect(); }
var connectionInfo = new PasswordConnectionInfo(host, username, password); connectionInfo.AuthenticationBanner += delegate(object sender, AuthenticationBannerEventArgs e) { Console.WriteLine(e.BannerMessage); }; using (var client = new SftpClient(connectionInfo)) { client.Connect(); // Do something here client.Disconnect(); }
See Also