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

New Post: Failing to Authenticate on SSH_MSG_USERAUTH_PASSWD_CHANGEREQ

$
0
0
Hi,

Sorry for late response.
The reason SSH_MSG_USERAUTH_PASSWD_CHANGEREQ needs to be sent its because it detects that username password needs to be changed.
I am no sure how and why FileZilla works, may be internally it changes password to itself again or uses some other trick, o might have a bug.
See if you can handle PasswordExpired event. This event is raised when you need to provide a new password.

Here is an example of how you would do it:
           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();
            }
Hope it helps.

Thanks,
Oleg

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>