sshnet / sshnet/SSH.NET

Keyboard interactive prompt not called

Open
#619 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

I have configured my Windows Open SSH Server to support keyboard interactive. When I attempt to connect I do not receive the authentication prompt callback but instead immediately get the following error:

Permission denied (keyboard-interactive).

This is my code:

var keyboardInteractiveAuth = new KeyboardInteractiveAuthenticationMethod(sftpClientCfg.User);
keyboardInteractiveAuth.AuthenticationPrompt += (sender, args) =>
{
    foreach (var authenticationPrompt in args.Prompts)
        authenticationPrompt.Response = sftpClientCfg.Pswd;
};

var connectionInfo = new ConnectionInfo(name, sftpClientCfg.Port, sftpClientCfg.User, new[] { keyboardInteractiveAuth });
using (var client = new SshClient(connectionInfo))
{
    client.Connect();
    Console.WriteLine("Connected");
}

And finally the server is logging the following errors:

userauth-request for user mike service ssh-connection method keyboard-interactive [preauth]
attempt 1 failures 0 [preauth]
keyboard-interactive devs [preauth]
auth2_challenge: user=mike devs= [preauth]
kbdint_alloc: devices '' [preauth]

When the server is configured to support either PasswordAuthentication or PubkeyAuthentication I am able to connect. This is the only method that is failing. I do not know if the server is incorrectly configured or if there is an issue with how I am connecting.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the KeyboardInteractiveAuthenticationMethod and ConnectionInfo entry points shown in the example, then reproduce the connection against the Windows OpenSSH configuration while reviewing the server's keyboard-interactive log. Done means determining whether the callback should be invoked for this server response and identifying a confirmed library or server-side cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.