Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: SshClient not firing PasswordExpired event

$
0
0
I've set up a virtual ubuntu 32bit machine with openssh. I expire my test user's password with the command:
sudo passwd -e sftptest
However, when I make a connection, it correctly connects and disconnects. If I use putty to connect, I am prompted to change my password.

Can someone help me figure out what's going on? My connection code is below:
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo(
    settings.Hostname, 
    (int)settings.PortNumber, 
    settings.Username, 
    "sftptest"
);
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();
}

Viewing all articles
Browse latest Browse all 1729

Trending Articles