[ 
https://issues.apache.org/jira/browse/SSHD-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Goldstein Lyor resolved SSHD-549.
---------------------------------
    Resolution: Not A Problem

The mechanism involved in the authentication seems to be "keyboard-interactive" 
(see [RFC4256 - section 3.1|https://www.ietf.org/rfc/rfc4256.txt]). In essence, 
the idea is that the server sends a series of prompts to which the client is 
supposed to returns a series of answers. Usually, the server sends one prompt - 
the password - but this is not mandated by the protocol. Now for the behavior 
you describe - you did not mention which SSHD version you are using, so I will 
assume the latest released - 0.14.0.

{quote}
I believe this password prompt is picked from the sshd_config file on the linux 
server where this SSH server is running.
{quote}
No it isn't - the Java code does *not* read this configuration file.

{quote}
the SSH server handler seems to be sending back the prompt like 
"username@hostname passsword:"
{quote}
The you are not connecting to the Java SSHD server. The code responsible for 
this authentication method resides in 
_org.apache.sshd.server.auth.UserAuthKeyboardInteractive_, and specifically the 
_doAuth_ method which clearly states:
{code:java}
buffer.putString("Password: ");
{code}
In other words this prompt is *hardwired* (it can be changed in the yet 
unreleased 1.0  version to some extent) - so if you are getting 
"username@hostname passsword:" then your code is not talking to the SSHD Java 
code.

{quote}Please let me know if there is any method in sshd libraries or any other 
solution I can use to override this password prompt during login.{quote}
Yes, you can - you need to write your own _NamedFactory<UserAuth>_ that handles 
the "keyboard-interactive" mechanism (see 
_org.apache.sshd.server.auth.UserAuthKeyboardInteractive_ as an example), and 
then configure the SSH server with it:
{code:java}
SshServer server = SshServer.setUpDefaultServer();
server.setUserAuthFactories(Arrays.asList<NamedFactory<UserAuth>>(
    (NamedFactory<UserAuth>) new UserAuthPassword.Factory(),  // if you also 
want "password" authentication mechanism
    (NamedFactory<UserAuth>) new UserAuthPublicKey.Factory(),  // if you also 
want "pubkey" authentication mechanism
    (NamedFactory<UserAuth>) new MyUserAuthKeyboardInteractiveFactory()    // 
your override for the "keyboard-interactive" mechanism
));
{code}

> Need to Change the password prompt
> ----------------------------------
>
>                 Key: SSHD-549
>                 URL: https://issues.apache.org/jira/browse/SSHD-549
>             Project: MINA SSHD
>          Issue Type: Test
>            Reporter: VENKATA DIGAVALLI
>
> Hi,
> I created the SSH server using Mina 2.0.7 libraries. During the login, the 
> client application is looking for the text "Password:" and the SSH server 
> handler seems to be sending back the prompt like "username@hostname 
> passsword:". 
> I believe this password prompt is picked from the sshd_config file on the 
> linux server where this SSH server is running. Tried changing that config 
> file, but still don't see any change in the password prompt text. 
> This is causing a failure during login. Please let me know if there is any 
> method in sshd libraries or any other solution I can use to override this 
> password prompt during login.
> Thanks,
> Venkata Digavalli



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to